Files
30-seconds-of-code/git/s/unstage-files.md
Angelos Chalaris 5c913d20bd Reorganize snippets
2023-05-03 21:19:02 +03:00

656 B

title, type, language, tags, author, cover, dateModified
title type language tags author cover dateModified
Remove files from the staging area snippet git
commit
chalarangelo coconuts 2021-04-13T21:10:59+03:00

Removes files from the staging area.

  • Use git restore --staged <pathspec> to remove files from the staging area.
  • <pathspec> can be a filename or a fileglob.
git restore --staged <pathspec>
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