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

后端 未结 6 1496
失恋的感觉
失恋的感觉 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:59

    What you want is git reset HEAD --hard. git reset HEAD only un stages changes.

    I suggest you also take a look at how git can be set to auto convert/deconvert line endings because on projects with multiple developers working on different platforms this will cause anger when a single edit on a file causes git blame to show you as having changed the whole file.

提交回复
热议问题