0

On some point of developing I used git stash save --all to stash my progress. But then, when I try to apply this stash: git stash apply stash@{0} it only get back new files, but files that were modified previously are not changed. It also shows message at the end: Could not restore untracked files from stash. That is interesting because actually untracked files are the only that were backed up.

If I run git stash show stash@{0} it shows me the files that were only edited, so edit files are not gone anywhere and they are still inside this stash.

How I can restore all the files, both untracked and modified?

tetiross
  • 192
  • 3
  • 17
  • Had the same error. I could solve it when I made a hard reset to the last commit on the branch and applied the stash again. Then I got all files from the stash (new and untracked files). –  Nov 08 '17 at 11:20
  • @Philj0 didn`t help.. – tetiross Nov 08 '17 at 11:27
  • What does `git stash show` shows? And you should look at this https://stackoverflow.com/questions/20586009/how-to-recover-from-git-stash-save-all/20589663#20589663 –  Nov 08 '17 at 11:29
  • @Philj0 diff between state of current files and files that are in stash – tetiross Nov 08 '17 at 11:31
  • 1
    to stash the untracked files you have to use the `-u` Parameter to include untracked files. (Sorry, I did not read your question correctly) You should read this https://stackoverflow.com/questions/20586009/how-to-recover-from-git-stash-save-all/20589663#20589663 for further information –  Nov 08 '17 at 11:38
  • @Philj0 I got my file changes back finally.. Here is what helped me: https://stackoverflow.com/a/10508919/4512509 . – tetiross Nov 08 '17 at 12:03

0 Answers0