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.
Written by Grace Cooper
Related protips
1 Response
or:
git reset --hard HEAD
git clean -fd
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#