0

I wanted to stash changes to an untracked file, and following the advice here, I tried git stash -u. Unfortunately, it deleted everything, and I can't find any way to get it back! git stash apply doesn't work. The files aren't even in the recycle bin. Is there anything I can do at this point?

It turns out that this is a known problem, but one that curiously wasn't mentioned in the Stack Overflow answers.

I'm using Git 1.8.1.msysgit.1 on Windows 7.

The output of git stash list is

stash@{0}: WIP on testing: 50c7eb3 testing
Community
  • 1
  • 1
Antimony
  • 37,781
  • 10
  • 100
  • 107
  • 1
    What's the output of `git stash list`? – MGP Mar 05 '14 at 20:04
  • @Manuel It's `stash@{0}: WIP on testing: 50c7eb3 testing`, but that's not going to help since the deleted files aren't in the stash. – Antimony Mar 05 '14 at 20:07
  • looks like a bug then, the `-u` should save non tracked files, it works for me on Linux with Git 1.8.5.3. – MGP Mar 05 '14 at 20:37
  • 1
    @manuel, apparently the problem has to do with having an untracked but not ignored folder that contains only untracked files. – Antimony Mar 05 '14 at 20:53
  • yes, tested that too, works ok on my system, maybe you should update your git. – MGP Mar 06 '14 at 13:26
  • @Manuel even if the problem is fixed in later versions, that wouldn't help me. The question here is if there's anyway to recover when it has already deleted your files. – Antimony Mar 06 '14 at 14:04
  • Fair point, you could check if the files ever hit the internal file system (Git objects): http://stackoverflow.com/questions/6545232/recovering-files-from-git-objects – MGP Mar 06 '14 at 14:18

0 Answers0