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
In your example, to restore to the state before git stash pop
, use:
git reset --hard bar
This form of the git reset
command restores the state of the index and the working directory to the head of the bar
branch.
Because you had conflicts on the first git stash pop
, the stash remains on the top of the stash stack.
From there, you can git checkout foo
and git stash pop
again.