Git Staging Area
The staging area (also called the index) holds the changes that will go into your next commit.
You add changes to it with git add, and take them out again with git restore --staged. This lets you choose exactly what each commit contains.
Stage a file
git add index.html
git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: index.html
Unstage the file again
The change stays in your working directory, it is just not staged:
git restore --staged index.html
git status --short
M index.html