1

I have 2 terminal windows, 1 for my Host machine and one for my vagrant machine.

I did a git stash save -u "database rework" on my host machine before temporarily chaning branches. The terminal printed:

Saved working directory and index state On feature/kanban: database rework
HEAD is now at 83a5566`

Then I changed to a branch on origin, and then changed back to my previous branch (without doing any changes).

THEN I changed to my vagrant machine terminal window, and ran git stash pop by accident (by accident, since I ALWAYS use git on my host machine, I haven't explicitly configured guest machine Git) and there it is, all my work is lost.

It popped some random changes, but my untracked files were not there.

Please tell me there's a way to recover it.

Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206
  • 1
    Possible duplicate of [How to recover a dropped stash in Git?](http://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git) – default Feb 06 '17 at 13:52
  • @Default that solution doesn't work with untracked files – Christopher Francisco Feb 06 '17 at 13:56
  • Do you want to reset all untracked files right now?? – DilumN Feb 06 '17 at 16:06
  • I'm surprised that the other method is giving you issues: `git fsck --no-reflog | awk '/dangling commit/ {print $3}'` should still find it as this is just a three-commit "stash bag" with the `w` commit "dangling". You can tell which dangling commit is the `w` commit by finding one that has three parents—these will be `i`, `u`, and `83a5566`. What precisely are you using from that dupilcate? – torek Feb 06 '17 at 18:11
  • Oh I see, I was using the `you will still have the hash value printed by git stash pop on screen` contribution by Dolda. But that only gave me the tracked files. – Christopher Francisco Feb 06 '17 at 19:17

0 Answers0