Command

git restore --staged

With an existing HEAD, restore selected index entries from HEAD while preserving working files. The staged version may be lost from the index.

Formal Syntax & Structure

git syntaxgit
git restore --staged -- PATH

Working Example

Example Snippetgit
git restore --staged -- notes.txt
Git Reference