You have to figure out which of the commits before the merge is the βmain lineβ, i.e. the part you want to keep. You can do this using git log :
commit b556759a560650506da58e59f6a7c6a2c4bcb8f4 Merge: e3dac0d 090ad85
... and a visual inspection of the two parent commits. (It seems that git merge foo will always put HEAD in the first position of the parent list and foo head in the second, but I'm not sure if this is guaranteed.)
Suppose e3dac0d is the main line, so we want to return the merge 090ad85 , then this
git revert -m e3dac0d b556759
For more information, see return erroneous merge with Torvalds and Hamano.
source share