git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how to undo a git merge?

From
Fff <ff@member.org>
Date
Jul 11, 2008, 18:46 UTC
Message-ID
<fa7d16350807111146m18b0ca9q6902c2167bfd3512@mail.gmail.com>
In-Reply-To
<20080711181413.GI10347@genesis.frugalware.org>
> [ Did you reply off-list intentionally? ]
ooops... yes... I'm scared of the reply-all button. :)
> For example, if you were on branch 'master' and you merged 'foo' to
> master using 'git merge foo', and you want to revert that merge then you
> need '-m 1'.
Ok, so... sorry for not getting it completely, even after reading the info.

In your example, how and why you can determine that the number 1 represents the "foo" branch? Would "-m 2" represent the master branch? In your example is there any other choice for the "-m" number to use?

-- ff
On Fri, Jul 11, 2008 at 2:14 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
Show 21 quoted lines
> [ Did you reply off-list intentionally? ]
>
> On Fri, Jul 11, 2008 at 02:07:44PM -0400, ff <ff@member.org> wrote:
>> thank you.
>>
>> 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?
>>
>> Thanks again!
>
> http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_parent
>
> A merge commit has two parents, but obviously only one of the was the
> HEAD commit before the merge. So when you revert a merge, you need to
> specify which which parent's tree should be the tree of the new HEAD.
>
> For example, if you were on branch 'master' and you merged 'foo' to
> master using 'git merge foo', and you want to revert that merge then you
> need '-m 1'.
>
Previous: Miklos VajnaNext: Miklos Vajna
Message 5 of 8 in “how to undo a git merge?”
  1. ffJul 11, 2008
  2. Miklos VajnaJul 11, 2008
  3. Jakub NarebskiJul 11, 2008
  4. Miklos VajnaJul 11, 2008
  5. ffJul 11, 2008
  6. Miklos VajnaJul 11, 2008
  7. Sverre RabbelierJul 11, 2008
  8. Jakub NarebskiJul 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.