You should be ok.  You can use the "git reflog" command to view the
history of what you've had checked out.  You can then checkout the
hash commit of your latest work again and create a branch from it.  Or
alternatively you can merge that hash back to master.

The (no branch) thing happens when you checkout a hash somewhere in
your history that isn't associated with any tag or HEAD of a branch.
If you then begin committing from there, you end up in the situation
you are in now.  It's easy to rectify, but sometimes hard to notice.
I insert this into my bash .profile so that the current branch is
displayed in my terminal prompt.  You may find it useful.

# Show the git branch in the prompt
PS1='[...@\h \W$(__git_ps1 " (%s)")]\$ '

dan

On Tue, Jun 1, 2010 at 1:27 PM, Trans <transf...@gmail.com> wrote:
>
> Looks like git just pissed away all my work for the last two months.
>
> I was doing everything like I normally do. I made my changes,
> committed and 'git push origin master'. Everything looked good. Git
> told me "Everything up-to-date". But... I went over to the project's
> github page (http://github.com/proutils/qed) and noticed that nothing
> has been pushed. How is "Everything up-to-date" if none of my changes
> are there?
>
> I was very confused and could only assume something was amiss with
> GitHub. So I put in a ticket. In reply I was asked what branch I was
> on). I'm the lone developer on this so I was on master.... or so I
> thought. I went to check just in case and discovered I was on
> something called "(no branch)".
>
>  tr...@logisys:qed$ git branch
>  * (no branch)
>    gh-pages
>    html-based
>    master
>
> What the hell is that? Where did it come from? And why?
>
> Now the kicker. I figured "strange, but no big deal" I switched back
> to master and was about to pull in "(no branch)", only to discover
> that "(no-branch)" was GONE! Nata, nothing. Not a word out of git
> about it. It's just not there and all my commits since April 7th have
> vanished.
>
> Someone please tell me there is some hope for getting them back.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/git-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to