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

Re: How to recover a lost commit...

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 11, 2010, 16:50 UTC
Message-ID
<20101111165023.GB16972@burratino>
In-Reply-To
<AANLkTinfYTMKicr3V=T=scVpOte_XrmaDgVA_oMj2fYU@mail.gmail.com>
Patrick Doyle wrote:
> But I'm curious... given the reflog show below... can any of you tell
> what I did to myself to shoot myself in the foot?  Aside from "use git
> stash next time dummy", is there any way I could have avoided this?

I don't know. :) But if you still have the svn_to_git_wip branch, you might want to try

	$ git log -g svn_to_git_wip
which just shows the history of that branch.
Show 6 quoted lines
> Today I want to pick up where I left off with the work-in-progress (on
> the "svn_to_git_wip" branch).  What I _really_ wanted to do was to
> grab the contents of that branch, dump them into my working directory
> for the master branch, and continue as if nothing had happened.  (This
> is exactly the use case for which git-stash was created, and I
> probably should have used that to begin with.)
Couldn't
	$ git cherry-pick --no-commit svn_to_git_wip
	$ git reset
or something like
	$ git merge --no-commit svn_to_git_wip
	$ git reset
have worked?

Hope that helps, Jonathan

Previous: Junio C HamanoNext: Patrick Doyle
Message 7 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.