1

I had some stashed code that I popped and made some changes to one of the popped files.

Is there a way to get that file state back to the state it was when it was stashed? Meaning discarding all changes on that specific file since git stash pop was executed.

callback
  • 3,981
  • 1
  • 31
  • 55
  • 2
    In general no, there isn't, because once you pop something from the stash, it is basically gone forever. For future reference, you should use `git stash apply`, which _doesn't_ pop the commit from the stack. – Tim Biegeleisen Feb 06 '19 at 12:05
  • For what it's worth, this is one reason why I don't like the stash. I tend to make a temporary branch with my local changes and rebase or cherry pick it where I need it. It's more work but I have full control and full revertability. But I realize that doesn't help you, since you've presumably already done the pop. – joanis Feb 06 '19 at 13:36
  • Possible duplicate of [How to recover a dropped stash in Git?](https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git) – Alderath Feb 06 '19 at 14:07

0 Answers0