How to undo 'git reset'?

前端 未结 5 1051
予麋鹿
予麋鹿 2020-11-22 09:17

What\'s the simplest way to undo the

git reset HEAD~

command? Currently, the only way I can think of is doing a \"git clone http://...\" fr

5条回答
  •  不知归路
    2020-11-22 10:15

    Old question, and the posted answers work great. I'll chime in with another option though.

    git reset ORIG_HEAD

    ORIG_HEAD references the commit that HEAD previously referenced.

提交回复
热议问题