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

Re: fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree.

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Oct 28, 2010, 13:41 UTC
Message-ID
<20101028134141.GA16149@neumann>
In-Reply-To
<loom.20101028T150254-457@post.gmane.org>
Hi Todd,
On Thu, Oct 28, 2010 at 01:09:08PM +0000, Todd Wells wrote:
Show 14 quoted lines
> I was using GitX to prepare a commit. Something happened -- I don't 
> know what --  and suddenly my branch only had a single commit 
> in it that appears to contain all  the files in my tree. So I went to the 
> command line and did this:
> 
> $ git reset --soft HEAD^ 
> fatal: ambiguous argument 'HEAD^': unknown revision or path not 
> in the working tree.
> 
> When I do 'git log' in this branch, there's only one commit. Now, I 
> had many commits in this branch a few minutes ago. I really, 
> really, don't want to lose this.
> 
> What steps should I take to attempt to recover?

Take a look at 'gitk yourbranch@{1}' or 'git log yourbranch@{1}'. If it looks like your branch's lost history, then you can recover from this situation with 'git reset --hard yourbranch@{1}'.

You can read up about the details here: http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#recovering-lost-changes

HtH, Gábor

Previous: Todd WellsNext: Mathias Lafeldt
Message 2 of 8 in “fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree.”
  1. Todd WellsOct 28, 2010
  2. SZEDER GáborOct 28, 2010
  3. Mathias LafeldtOct 28, 2010
  4. Santi BéjarOct 28, 2010
  5. davilda_Sep 9, 2015
  6. Jeff KingSep 9, 2015
  7. Junio C HamanoSep 9, 2015
  8. Santi BéjarOct 28, 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.