git untracked changes remove code example Example: git discard untracked # if you want to clean directories as well add -d git clean -fd