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

后端 未结 18 3436
逝去的感伤
逝去的感伤 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:54

    If you're really lucky, like I was, you can go back into your text editor and hit 'undo'.

    I know that's not really a proper answer, but it saved me half a day's work so hopefully it'll do the same for someone else!

提交回复
热议问题