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

后端 未结 17 1646
无人及你
无人及你 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:57

    To keep the log clean as nothing happened (with some downsides with this approach (due to push -f)):

    git checkout 
    git reset --hard 
    git push -f origin HEAD:
    

    'commit-hash-before-merge' comes from the log (git log) after merge.

提交回复
热议问题