重置后还原Git提交

时间 2019-02-19
阅读 15
点赞 0
收藏 0
连接sejong-jang

我做了git重置后,所有的工作都丢失了,我想撤销重置头的操作。

这是我的日志:

c2415f9 (HEAD -> master) HEAD@{0}: reset: moving to HEAD@{4}

c2415f9 (HEAD -> master) HEAD@{1}: reset: moving to HEAD@{1}

efc857e HEAD@{2}: reset: moving to HEAD~9

c2415f9 (HEAD -> master) HEAD@{3}: reset: moving to HEAD~1

ee49352 HEAD@{4}: commit: update design

c2415f9 (HEAD -> master) HEAD@{5}: commit (merge): design update

bd7b690 HEAD@{6}: commit: design update2

dbcdb7c HEAD@{7}: commit: design update

c376c79 HEAD@{8}: reset: moving to HEAD^

1f0e877 HEAD@{9}: reset: moving to HEAD^

a801027 HEAD@{10}: commit: design update

1f0e877 HEAD@{11}: reset: moving to HEAD~1

7b298f1 HEAD@{12}: commit (amend): design update

f25ac06 HEAD@{13}: commit: design update

1f0e877 HEAD@{14}: commit (merge): temp4

c376c79 HEAD@{15}: commit: UI and icon updated

5116b62 HEAD@{16}: commit: error changes

d642af7 HEAD@{17}: commit (merge): menifast

b4785c0 HEAD@{18}: commit: xml

6fb07e9 HEAD@{19}: reset: moving to HEAD

6fb07e9 HEAD@{20}: checkout: moving from temp to master

a5649d7 (origin/temp, temp) HEAD@{21}: reset: moving to HEAD

我想回到头5,我只想撤销所有重置操作!帮帮我!

建议答案

获取提交的标识符。然后使用:

git reset <commit-retrieved-using-reflog>

所以,对你来说:

git reset HEAD@{5}
👍 0