我試圖從我的Git工作區推到Github,但我添加和提交的更改似乎沒有上傳。似乎在「(無分支)」,然後失去了我的變化
然後,做一個「混帳分支」我得到的東西是這樣的:
git branch
* (no branch)
master
愚蠢,我以爲我可以重新進入主與
git checkout master
,現在我的改變似乎去了。我的主分支大約三天。似乎沒有辦法切換回這個(沒有分支)。
我檢查了這個問題Git : seemed to be in 「(no branch)」 and then lost my changes答案建議做一個git reflog show
然後結帳。我想,我得到這個:
$ git reflog
0f27ae7 [email protected]{1}: checkout: moving from HEAD to master
7b8ee7b [email protected]{2}: commit: 14/05/2017 3:33pm
ff60409 [email protected]{3}: commit: 14/05/2017 3:33pm
0f27ae7 [email protected]{4}: checkout: moving from master to 0f27ae7236aabbe8cccfba82e201e36368a05054
0f27ae7 [email protected]{5}: commit: 11/05/2017 2:33pm
3e4c616 [email protected]{6}: merge origin/master: Fast-forward
1e79818 [email protected]{7}: commit: 10/5//2017 UI
我試着做一結帳從0f27ae7236aabbe8cccfba82e201e36368a05054
但我的變化是不回來了。我想要的是恢復我在(無分支)(承諾:14/05/2017 3:33 pm)作出的最後提交。
這裏是git branch -a
結果:
$ git branch -a
* (HEAD detached from 0f27ae7)
UI_linking
master
remotes/ado/newBranch
remotes/origin/UI_linking
remotes/origin/frogs1
remotes/origin/master
remotes/origin/newBranch
remotes/origin/newMas
是我的變化失去了什麼?還是有辦法恢復它們?
你可以顯示git branch -a嗎? – DreamInBox
我將它添加到問題中。 –