git stash --keep-index

Stashes changes, keeping index intact

This command temporarily stashes changes made in the working directory, but leaves the index (staged changes) untouched.

This makes it possible to continue working on staged changes, while any unstaged changes are stashed away for later use.

Variations of this command include git stash (which stashes both staged and unstaged changes) and git stash --include-untracked which also stashes untracked files.

Sign in to enable bookmarking, reminders, progress-tracking and more...