我在我的git 2分支,master和SSL上。
雖然我以爲我在主分支,但我實際上已經分離了。我將更改推送到HEAD,然後結帳到SSL分支併合並它。
當我這樣做時,我發現承諾給主人的變化在任何分支上都不存在,我看不到它們。
有沒有辦法恢復丟失的提交?
運行git reflog -n 20
:在分離HEAD時推送恢復更改
e4a206b [email protected]{0}: checkout: moving from SSL to master
94e0f8d [email protected]{1}: checkout: moving from master to SSL
e4a206b [email protected]{2}: checkout: moving from SSL to master
94e0f8d [email protected]{3}: reset: moving to 94e0f8d
18aedb9 [email protected]{4}: checkout: moving from master to SSL
e4a206b [email protected]{5}: checkout: moving from e4a206b20456d004b5ad19bb859e15f481df9b90 to master
e4a206b [email protected]{6}: checkout: moving from SSL to master^0
18aedb9 [email protected]{7}: checkout: moving from master to SSL
e4a206b [email protected]{8}: checkout: moving from e4a206b20456d004b5ad19bb859e15f481df9b90 to master
e4a206b [email protected]{9}: checkout: moving from master to master^0
e4a206b [email protected]{10}: checkout: moving from d8b6feee2ae2595872d62ca2b25c01263b3bf74b to master
d8b6fee [email protected]{11}: merge SSL: Merge made by the 'recursive' strategy.
94e0f8d [email protected]{12}: commit: Support for os and badge count for ios
e4a206b [email protected]{13}: checkout: moving from 18aedb908898083d8b9d6941ec59f981950a3846 to master^0
18aedb9 [email protected]{14}: checkout: moving from bc071caacff35fca304aae97804fd9070d92913f to SSL^0
bc071ca [email protected]{15}: commit: Added support for sell option
e4a206b [email protected]{16}: checkout: moving from 18aedb908898083d8b9d6941ec59f981950a3846 to master^0
18aedb9 [email protected]{17}: checkout: moving from e4a206b20456d004b5ad19bb859e15f481df9b90 to SSL^0
e4a206b [email protected]{18}: checkout: moving from SSL to master^0
18aedb9 [email protected]{19}: commit: SSL
我已經做了硬復位到提交我想,它仍然缺少一個文件(我真的不知道該怎麼做)。
當你說「走了」,你想改變麥凱納t出現在主人面前,但他們出現在你的另一個分支上? – Makoto
請描述這裏「逝去」的意思。如果您確實將更改提交給主分支,那麼很難失去這些更改。你做過「git reset」嗎?你有沒有試過檢查主人? –
我已經更新了這個問題。 –