Undo git reset –hard after git stash pop

I had some changes in the stash that I attempted to recover using git stash pop. There were some merge conflicts, and rather than resolving them, I decided to just reset it. Unfortunately, in a moment of stupidity, I did a git reset --hard, and now all of the previously stashed changes are gone.

Is there any way to recover these changes? I’ve tried git fsck --cache --no-reflogs --lost-found --unreachable HEAD, but none of the commit hashes listed refer to the changes I need. What else can I do? or did I just lose all of that work?

  • Aborting `git stash apply`
  • How do I properly git stash/pop in pre-commit hooks to get a clean working tree for tests?
  • Can't pop git stash, 'Your local changes to the following files would be overwritten by merge'
  • Undo git stash pop on dirty working tree
  • On local branch, don't want to commit changes, but need to switch to another branch
  • No stash found when using git stash branch
  • Is it possible to combine stash pops in Git?
  • What are the conceptual differences between Merging, Stashing and Rebasing in Git?
  • 2 Solutions collect form web for “Undo git reset –hard after git stash pop”

    Just after posting this, I thought to check .git/refs/stash, which I thought would be blank after the pop. However, likely due to the merge conflict, it still had the hash from the stash I had tried to pop!

    I did a git stash apply with the hash and a git reset to resolve the merge conflicts the lazy way.

    Sorry if this was a git-noob question and answer. Hopefully this helps someone else.

    git help stash :

    Applying the state can fail with conflicts; in this case, it is not removed from the stash list. You need to resolve the conflicts by hand and call git stash drop manually afterwards.

    so the stash you though has gone is still in your stash list, just git stash list to find it.

    Git Baby is a git and github fan, let's start git clone.