remove or undo last merge git 1

remove or undo last merge git

git reset --merge ORIG_HEAD

Here is what the above code is Doing:
1. git reset –merge ORIG_HEAD
– This will reset the index and the working tree to the state of the current branch,
but it preserves the changes already added to the index.
– ORIG_HEAD is a reference to the previous state of the current branch, before the
most recent pull.
– This command is equivalent to git reset –merge HEAD.
2. git add .
– This adds all the changes to the index.
3. git commit -m “Conflict resolved”
– This commits the changes to the index.

Similar Posts