how to remove untracked files from git without deleting code example Example 1: git remove untracked files git clean -fdx Example 2: git remove untracked files git clean -f