undo all untracked changes git code example
Example 1: git discard untracked
# if you want to clean directories as well add -d
git clean -fd
Example 2: clear untracked files git
git clean -n
# if you want to clean directories as well add -d
git clean -fd
git clean -n