Why won't “git reset HEAD” undo my uncommitted, unstaged changes?

后端 未结 6 1567
失恋的感觉
失恋的感觉 2021-02-05 09:30

I\'ve previously been able to undo changes through SourceTree by performing the \"Discard\" function, which under the hood produces this command:

git -c diff.mne         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 09:49

    I ran into something similar. My setup is using git on a web server to pull down the most recent code. For an unknown reason, it ran into this issue.

    # git reset HEAD —hard
    

    Unstaged changes after reset:

     'File Name'
    

    I tried all the suggested things here. None fixed it.

    I fix it in this case by doing

    git add 'File Name'
    

    then,

    git reset --hard HEAD
    

    Which cleared the issue for me.

提交回复
热议问题