Git|記一次誤提交的解決辦法

niceforbear發表於2016-05-26

在不應該開發的分支,進行了開發,並且進行了commit和push.

回滾:

git branch
# error_branch

git branch new_branch_for_backup
git reset --hard commit_id
git push origin:error_branch

git checkout right_branch
git merge new_branch_for_backup
git branch -d new_branch_for_backup
git push

參考:

  1. http://www.cnblogs.com/qualitysong/archive/2012/11/27/2791486.html

相關文章