[Git] Preview which untracked files git clean would remove

Created on November 30, 2026

Run git clean -n to preview the untracked files eligible for removal. This example assumes Git tracks README.md and memo.tmp is untracked.

git clean -n
Would remove memo.tmp

-n is short for --dry-run. It leaves the listed files on disk. Ignored files are excluded by default. Add -d to preview eligible untracked directories as well.

Check this preview before using --force, because Git cannot recover untracked files removed by git clean.

Reference

Git