How to undo local changes in git

Lets say you have a cou­ple of changes in your work­ing direc­tory that you want to dis­card. There are a few ways in which you can accom­plish 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 work­ing directory

git reset --hard HEAD

You may also like...

Leave a Reply

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