Resetting local changes in git


#1

Originally published at: https://contextualelectronics.com/topic/resetting-local-changes-in-git/

Commands used git reset git reset --hard


#2

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.


#3

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


#4

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