Git|记一次误提交的解决办法

在不应该开发的分支,进行了开发,并且进行了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

    原文作者:niceforbear
    原文地址: https://segmentfault.com/a/1190000005353827
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞