How to undo git merge

Revoke a merger

If you think the state after you merge a mess, trying to give up the current modifications, you can state before the merger with the following command returned:

$ git reset --hard HEAD

Or you have the code after the merger submitted, but they still want to revoke:

$ git reset --hard ORIG_HEAD

But just this command can be dangerous in some cases, if you have been to a branch to another branch of the merged deleted, then later at the time of merger-related branch will go wrong.

Guess you like

Origin www.cnblogs.com/zhukaijie/p/11865069.html