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

后端 未结 17 1914
无人及你
无人及你 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 08:01

    As Ryan mentioned, git revert could make merging difficult down the road, so git revert may not be what you want. I found that using the git reset --hard command to be more useful here.

    Once you have done the hard reset part, you can then force push to the remote branch, i.e. git push -f , where is often named origin. From that point you can re-merge if you'd like.

提交回复
热议问题