0

This morning while moving quickly from branch to branch, I had to stash my changes. In my haste, I issued a

git stash clear

-- as my stash list was rather long. In the list of stashes that I cleared was some work I need to recover. Is there a way to recover it? The stash in question was saved using:

git stash save "my notes here"

Not sure that really helps. Is there any hope?

rsturim
  • 6,388
  • 14
  • 43
  • 58

1 Answers1

0

As any stash is like a commit, but handled differently, you'll find them in the reflog. You can access the reflog via git reflog, where you get a list of all commit objects recently made.

Femaref
  • 58,195
  • 7
  • 126
  • 170
  • I am finding that I need to use `git reflog --all` to see anything regarding stashes. Sadly, what I get back is only the very last stash that was created (or 'pop'). When I navigate to the '/.git/refs' folder and examine the 'stash' file in Textmate, indeed -- it only show that single (and lonely SHA1). It would seem to me that `git stash clear` is destructive, and unrecoverable. – rsturim Nov 30 '12 at 19:40
  • That's unfortunate. Did you check the link in the comment on your question? That might help. – Femaref Nov 30 '12 at 20:00
  • thanks @Femaref -- it also did not help (thanks @Ashfame). Turns out my files were not tracked -- and I believe that was the crux of my problem. – rsturim Nov 30 '12 at 20:59