How to undo local changes in git

Lets say you have a couple of changes in your working directory that you want to discard. There are a few ways in which you can accomplish this.

1) Stash all your changes, then drop the stash

git stash
git stash drop

2) Do a hard reset from head. This moves data from the head to the stage as well as the working directory

git reset --hard HEAD

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *