Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

git-stash

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 :)

like image 603
Gagan93 Avatar asked Jul 07 '15 15:07

Gagan93


1 Answers

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

like image 165
Nghia Bui Avatar answered Oct 04 '22 18:10

Nghia Bui