Here is at least a partial answer that works if you have a merge conflict during stash pop . As mentioned in my question, stash used by the Smart Checkout function to hide your local changes and then apply them to the new branch after deleting it.
The way Intellij does this is used by stash in the branch you are currently in, and then using stash pop in the branch you are switching to.
When changes are hidden, they are pushed onto the stack of folded changes at the top. Then, when stash pop starts, these changes exit the stack and apply.
At least in most cases, what happens. However, if there is a merge conflict, Intellij informs you of this, and the cache remains. You can see the delay stack by running:
git stash list
If you want to keep everything you want, just check which branch was originally included. Reset it, then do stash apply , which is similar to stash pop , but will not remove stash from the list. So:
git checkout $original-branch git reset HARD git stash apply
Then, if all goes well, you can remove the tab using:
git stash drop
Since this answer is rather crude and covers only one situation, I mark it as a community wiki. Improvements are very welcome.
source share