Git 用来描述你的工作目录状态是 a & ldquo; 头部分离。这是另一个 git reflog拯救的地方。
$ git reflog
0b40dd6 HEAD@{0}: commit: my commit on detached HEAD
...
如果我尝试签出一个不同的分支,git-1.7.5.1会给出一个有用的建议。
$ git checkout master
Warning: you are leaving 1 commit behind, not connected to
any of your branches:
0b40dd6 my commit on detached HEAD
If you want to keep them by creating a new branch, this may be a good time
to do so with:
git branch new_branch_name 0b40dd65c06bb215327863c2ca10fdb4f904215b
Switched to branch 'master'