我用更新檢出了另一個分支,然後做了一些更改,切換回主Git,現在變化消失了!我可以讓他們回來嗎?終端基本上是:如何從'分離頭狀態'恢復提交?
$ git commit
[detached HEAD 7c09e17] Fixed some stuff
files changed, insertions(+), deletions(-)
$ git push master
fatal: 'master' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
$ git checkout master
Previous HEAD position was 7c09e17... Fixed some stuff
Switched to branch 'master'
$ git merge theother/directory
dup http://stackoverflow.com/questions/4845505/gitx-how-do-i-get-my-detached-head-commits-back-into-master? – smparkes 2012-01-27 22:56:19