Last Updated: February 25, 2016
·
852
· lishamatish

Discarding local modifications.

This may be useful, should you make changes in the wrong branch by accident or something. You can use this to discard local changes.

First:
git stash save—keep-index
( This stashes your changes )

Then:
git stash drop
( This drops the changes )

You will then be back to where you were before you made any local modifications.

1 Response
Add your response

or:

git reset --hard HEAD
git clean -fd
over 1 year ago ·