Search code examples
gitgit-stash

Untracked files lost after git stash, working on branch and stash pop


Please understand the scenario:
1. created a new branch a day ago and pushed my work there.
2. worked on sublime whole day, modified existing files, created some new files.
3. Didn't add or commit, but stashed, switched to another branch, commited there and popped the stash

Whoa !! new files (untracked files) lost

Is this the normal behaviour of stash or I might get this data back.

Any help would be appreciated. Thanks :)


Solution

  • Please use the -u option when you create your stash. Take a look on https://www.kernel.org/pub/software/scm/git/docs/git-stash.html