我在我的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”吗?你有没有试过检查主人? –
我已经更新了这个问题。 –