Skip to content

Home

Remove files from the staging area

Removes files from the staging area.

git restore --staged <pathspec>

# Examples
git restore --staged "30seconds.txt"
# Remove the file `30seconds.txt` from the staging area

git restore --staged src/*.json
# Remove all files with a `.json` extension in the `src` directory

git restore --staged .
# Remove all changes from the staging area

More like this

Start typing a keyphrase to see matching snippets.