Quickly reset working directory to HEAD, removing untracked files
git checkout --force <BRANCH>
works well if you want to throw away all local uncommitted changes, but it won't remove untracked files. However, once git is aware of a file in the staging area the same command will remove it. Precede the above with a git add .
to remove everything not versioned.
Written by Blaine Pace
Related protips
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#