GIT undo merge local and remote repo

In local or remote, wrong merge will require to revert immediately. But do not use hard reset if the merge have not been committed.
Immediately once did the merge process and found it wrong, to preserve changes we made before, use ORIG_HEAD:

$ git reset --merge ORIG_HEAD 

If the wrong merge has conflict and haven’t committed, use abort with newer git versions:

$ git merge --abort 

By Keenlio, April 24, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *


× 4 = thirty six

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>