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

Re: how to undo a git merge?

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jul 11, 2008, 18:53 UTC
Message-ID
<20080711185332.GJ10347@genesis.frugalware.org>
In-Reply-To
<fa7d16350807111146m18b0ca9q6902c2167bfd3512@mail.gmail.com>
On Fri, Jul 11, 2008 at 02:46:15PM -0400, ff <ff@member.org> wrote:
> ooops... yes... I'm scared of the reply-all button. :)
Also please don't top-post, thanks. ;-)
> 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?

If the merge has two parents, then the first one is the actual branch and the second is the 'other' branch.

So if 'master' is checked out, you did a 'git merge foo', and you want to do a revert, '1' stands for 'master' and '2' for 'foo'.

Previous: ffNext: Sverre Rabbelier
Message 6 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.