It should be possible:
git stash --keep-index
git commit -m "work in progress"
git branch wip
git reset --hard HEAD~
git stash pop
git add .
git commit -m "commit now the changes"
The work currently in the index is now in branch wip
.
The changes (not added to the index) are stashed first (hence the --keep-index
)
And the index of the branch you were in initially represents the changes you were working on and that you can commit on master
.