Re: how to undo a git merge?
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jul 11, 2008, 18:36 UTC
- Message-ID
- <200807112036.13745.jnareb@gmail.com>
- In-Reply-To
- <fa7d16350807111108y3a8a7c3di19598a56dbbcdc15@mail.gmail.com>
ff (?) wrote:
> > I did see the -m option in the revert man page. It talks about > "parent" and I did not understand what that is. Is parent the commit > id of the merge commit?
It is _number_ of parent.
-m parent-number, --mainline parent-number
Usually you cannot revert a merge because you do not know which side
of the merge should be considered the mainline. This option speci-
fies the parent number (starting from 1) of the mainline and allows
revert to reverse the change relative to the specified parent.Merge commit has more than one parent. What git-revert does, it creates commit which reverts the changes, as if applying "reversal" diff, "git diff -R <revision>^<parent-number> <revision>".
-- Jakub Narebski Poland