yong ho yong ho - 4 months ago 16
Git Question

After git reset, trying to merge again, but not saying conflict

I messed up the codes after I merged branch

feature-search
to
master
. So I am trying to redo the merge and fix the conflict again. So I
git reset hard -- eae8ee4
.
eae8ee4
is the commit before the merge.

Then I try to merge the branch to master again. It didn't show any conflict error. It seems the master still contains the merged codes. So how do I do a merge and fix conflict again?

Answer

Use git reflog, find the HEAD@{...} prior to that dreadful merge and do git reset --hard HEAD@{id} (where id is a number). This will revert your code to the state it was prior to that merge

Comments