GitCheatSheet.org logo
Home / How To

Unstage file using "git restore"

The "restore" command was introduced in Git version 2.23.0

git restore --staged fileToUnstage.txt

Unstages the file without changing the file contents. It will still be seen as modified, but not staged for commit.