Recover from git reset --hard?

后端 未结 22 2943
盖世英雄少女心
盖世英雄少女心 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:38

    If you are trying to use the code below:

    git reflog show
    # head to recover to
    git reset HEAD@{1} 
    

    and for some reason are getting:

    error: unknown switch `e'

    then try wrapping HEAD@{1} in quotes

    git reset 'HEAD@{1}'
    

提交回复
热议问题