git 撤銷修改:未push 、已push

場景:不小心把一次錯誤的代碼push到遠程服務器上的分支上,需要立即刪除/撤銷這次代碼提交。 具體方法,git命令: git log git reset --hard <commit_id> git push origin HEAD --force   【命令詳解】 獲取commit_id: git log commit_id形如:126f206185f225879f2723ca421f4dee4
相關文章
相關標籤/搜索