How can I undo git reset --hard HEAD~1?

后端 未结 18 3110
逝去的感伤
逝去的感伤 2020-11-22 00:21

Is it possible to undo the changes caused by the following command? If so, how?

git reset --hard HEAD~1
18条回答
  •  [愿得一人]
    2020-11-22 00:53

    The answer is hidden in the detailed response above, you can simply do:

    $> git reset --hard HEAD@{1}
    

    (See the output of git reflog show)

提交回复
热议问题