github刪除已經push到服務器上的commit的方法

使用兩條指令:

git log

git reset --hard <commit_id>

git push origin HEAD --force

其中commit_id是你想回到的commit的id(即想刪除的commit的前一個commit),可以在github.com的commit中查看。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章