git restore --staged file.txt

Category: Git - Core

git restore --staged file.txt

Unstage a file while keeping working directory changes

Removes a file from the staging area (unstages it) without losing your changes in the file.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.