Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Santi Béjar <hidden>
Date: 2016-06-15 22:49:55

Please, don't top post, it's difficult to follow a "reversed" conversation.

On Thu, Oct 28, 2010 at 3:54 PM, Todd Wells [off-list ref] wrote:
Thanks all of you for your speedy responses.
git log -g does indeed show my previous commits, for example:

Reflog: HEAD@{0} (Todd Wells [off-list ref])
Reflog message: commit: convert mason template to use
ProjectService.getAllGroups()
Author: Todd Wells [off-list ref]
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help