Re: fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree.
- From
Mathias Lafeldt <misfire@debugon.org>
- Date
- Oct 28, 2010, 13:42 UTC
- Message-ID
- <4CC97DC8.1010508@debugon.org>
- In-Reply-To
- <loom.20101028T150254-457@post.gmane.org>
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?
Check if you can reset your HEAD to a previous state saved in your (local) reflog.
See section "RefLog Shortnames" in http://progit.org/book/ch6-1.html
-Mathias