Git Working Directory
The working directory (also called the working tree) is the files you see and edit in your project folder.
When you change a file, the change is only in the working directory. Git does not save it until you stage it with git add and commit it.
A change in the working directory
After editing index.html, git status shows the change as not staged:
git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: index.html
no changes added to commit (use "git add" and/or "git commit -a")
Throw away the change
git restore puts the file back the way it was in the last commit:
git restore index.html
git status --short