Recover from git reset --hard?

后端 未结 22 2845
盖世英雄少女心
盖世英雄少女心 2020-11-22 00:52

Is there any way to recover uncommitted changes to the working directory from a git reset --hard HEAD?

22条回答
  •  深忆病人
    2020-11-22 01:36

    You can get back a commit after doing a reset --hard HEAD.

    Make use of "git reflog" to check the history of the HEAD in the branch.

    You will see your commit and its id here.

    Do a

    git reset {commit Id of the commit you want to bring back}
    

提交回复
热议问题