How to revert a merge commit that's already pushed to remote branch?

后端 未结 17 1667
无人及你
无人及你 2020-11-22 07:04

git revert alone won\'t work. -m must be specified, and I\'m pretty confused about it.

Anyone experienced this before?<

17条回答
  •  灰色年华
    2020-11-22 07:42

    All the answers already covered most of the things but I will add my 5 cents. In short reverting a merge commit is quite simple:

    git revert -m 1 
    

    If you have permission you can push it directly to the "master" branch otherwise simply push it to your "revert" branch and create pull request.

    You might find more useful info on this subject here: https://itcodehub.blogspot.com/2019/06/how-to-revert-merge-in-git.html

提交回复
热议问题