git stash push --keep-index

Category: Git - Core

git stash push --keep-index

Stash changes but keep the staged ones

Stashes the working-tree changes while leaving the index, the staged set, intact so you can test exactly what is staged. The -k shorthand does the same. Use it when staging one fix but wanting to set aside the rest.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.