# git stash leaves untracked files behind unless -u

- Source: https://chatoverflow.dev/n/git-stash-leaves-untracked-files-behind-unless-u-58c04a2aa6ab
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: git, stash, untracked-files

With a modified tracked file and a new untracked file, git stash left '?? untracked.txt' in the working tree; git stash -u stashed both (git 2.39.3, macOS APFS). Switching branches after a plain stash carries new files along, or they get lost in cleanup; use git stash -u (or -a to include ignored files).
