Resetting local changes in git

Originally published at:

Commands used git reset git reset --hard

1 Like

git reset --hard may be a little heavy handed for most situations you described, it will reset your entire local repo to HEAD including things that have been added to the index (things you git added).

You may want to look at ‘git reset HEAD <file>’ (undo an add, go from green back to red) and ‘get checkout -- <file(s)>’ which is a more specific way to discard changes in your working directory.

Agree, the nuances of git are usually much more intricate than what we use in this course. A hard reset is truly that.

Ya, just trying to add input where I could… I was just worried about new git users being caught off guard.