1

I have lost a lot of work, which was not staged. However I did stash it, and then unstash it, before losing it. Does git save this info anywhere?

Edit: I still had the dropped stash reference ID in my terminal, so was able to recover using Dolda's suggestion in How to recover a dropped stash in Git?

Nodeocrat
  • 816
  • 2
  • 14
  • 29
  • Can you please elaborate a little on what the flow was? How can I **reproduce** your problem? At a guess, I think you have done: `git stash; git stash pop; git reset HEAD --hard` ? – Tom Lord Aug 14 '18 at 09:43
  • @TomLord Unfortunately I can't remember exactly how I lost the work, but I am assuming this happened: I stashed my work, went to a different branch, then back to my working branch, unstashed, and the changes were not updated in my editor. Then I must have saved my editor, which basically deleted the unstashed work. – Nodeocrat Aug 14 '18 at 09:49
  • @jonrsharpe Thanks, that has the answer I was looking for :) – Nodeocrat Aug 14 '18 at 09:57
  • This isn't exactly a solution to your problem, but in future I would suggest committing the changes to the branch, rather than stashing them. (You can always later reset/squash the commit.) – Tom Lord Aug 14 '18 at 09:57
  • Stashing is only the best solution, I find, when you don't yet know which branch the changes belong on. – Tom Lord Aug 14 '18 at 09:58

0 Answers0