git刪除錯誤提交的commit

有時候push了錯誤的信息,爲了防止patch的時候錯誤的log,因此須要清除錯誤的commitgit

git log --oneline  #查看提交歷史commit

git reset --hard <commit_id>  ##完全回退到某個版本,本地的源碼也會變爲上一個版本的內容

git push origin HEAD --force  ##強制push
相關文章
相關標籤/搜索