The problem comes from the --keep-index
. The changes you stashed are in conflicts with the changes you already staged.
Here are commands you can use to reproduce
echo bar > foo
git add foo
echo baz > foo
git stash --keep-index
git stash pop #CONFLICT
In that case git doesn't know whether bar or baz should be present in foo...
The solution would be not to use the --keep-index
argument or to commit the changes you added first (you can always amend your commit later)
You can also get your working directory in the same state that before using git stash branch <branchname>
(you will then have to merge the branch)