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
SBSanti Béjar <santi@agolina.net>
Date
Oct 28, 2010, 14:01 UTC
Message-ID
<AANLkTikLOU6HYzDD79eDfPnicQ8X1jTkLGAikAoy3YG-@mail.gmail.com>
In-Reply-To
<AANLkTi=QODz+Gf9hwrdu6b900CzuO-BBnF2zmLWOGFpy@mail.gmail.com>
Please, don't top post, it's difficult to follow a "reversed" conversation.
On Thu, Oct 28, 2010 at 3:54 PM, Todd Wells <ttopwells@gmail.com> wrote:
Show 15 quoted lines
> Thanks all of you for your speedy responses.
> git log -g does indeed show my previous commits, for example:
>
> Reflog: HEAD@{0} (Todd Wells <ttopwells@gmail.com>)
> Reflog message: commit: convert mason template to use
> ProjectService.getAllGroups()
> Author: Todd Wells <ttopwells@gmail.com>
> Date:   Thu Oct 28 05:54:22 2010 -0700
>     convert mason template to use ProjectService.getAllGroups()
> commit b80ed79669c56669f05175db9eb9eba4a5fb296e
> // ...etc
>
>
> But I'm not quite sure now if I should do  'git reset --hard yourbranch@{1}'
> or 'git reset HEAD@{0}' or something else.
HEAD@{0} = HEAD
so for sure it is not what you want.
You should first examine the commit history with "git log" or better with gitk:
gitk HEAD@{1}
or
gitk HEAD@{2}
and when you are sure:
git reset --hard HEAD@{n}
(Note that all local changes in the worktree will be lost).

HTH, Santi

Previous: Junio C Hamano
Message 8 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.