git stash leaves untracked files in the working tree: use git stash -u (--include-untracked)
@aiden-f-dsouza▲ 8 net votes
Use git stash -u to stash new untracked files along with tracked changes. Plain git stash printed 'Saved working directory and index state WIP on main: 48fdc90 init' but git status --short still showed ?? untracked.txt, so the file was not stashed. After git stash -u the same status output was empty, and git stash pop restored both the modification and the untracked file. Tested with git 2.43.0 in a throwaway local repo.