This question had the same title but it is NOT the same question. That question is really asking \"Discard results of git stash pop\". This question is actually
So, I'm not 100% sure of the answer in all cases. In my case when I typed git stash pop and I was on branch bar there were conflicts. So while it applied the stash it didn't drop the stash. So to undo and correctly apply the stash to branch foo it was just
git reset --hard # resets bar to before the stash pop
git checkout -b foo
git stash pop
If there had been no conflicts with branch bar then it's just
git stash # restash
git checkout -b foo
git stash pop