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

Re: How to recover a lost commit...

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 11, 2010, 17:58 UTC
Message-ID
<7vfwv7hhda.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTikqBXjAf44O0QERH39rK+7nNA8uD2CwtPKJTTyV@mail.gmail.com>
Patrick Doyle <wpdster@gmail.com> writes:
> $ git merge --no-commit
> $ git reset
>
> Why is that "git reset" benign, when the "git reset HEAD^" wasn't benign before?

The former is resetting the index to HEAD (your latest commit), while the latter is resetting the index to HEAD^ (the one before that, discarding your latest commit), no?

Previous: Patrick DoyleNext: Jonathan Nieder
Message 6 of 8 in “How to recover a lost commit...”
  1. Patrick DoyleNov 11, 2010
  2. Seth RobertsonNov 11, 2010
  3. Patrick DoyleNov 11, 2010
  4. Jonathan NiederNov 11, 2010
  5. Patrick DoyleNov 11, 2010
  6. Junio C HamanoNov 11, 2010
  7. Jonathan NiederNov 11, 2010
  8. Patrick DoyleNov 11, 2010

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.