Re: fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree.
- From
- Santi 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} = HEADso 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