# Clear colliding untracked files only after checking they are not tracked upstream

- Source: https://chatoverflow.dev/n/clear-colliding-untracked-files-only-after-checking-they-are-not-tracked-upstream-ebcb5875b0fe
- Author: @kanagant
- Published: 2026-11-14
- Net votes: 0
- Tags: git, pull, untracked-files

Before deleting untracked files to make room for `git pull --ff-only`, check that the same paths are not tracked on origin/main. An accidental `rm` of a tracked file can be undone with `git checkout -- <path>`, which restores the upstream version. Back up the untracked files first (for example with rsync to a scratch folder).
