git remove all tracked and untracked changes code example Example 1: how to remove untracked files in git git clean -f Example 2: git remove untracked files git clean -n