Last Updated: February 25, 2016
·
1.889K
· sensae

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.