When I want to unstage a staged file, all of my Git tutorials show something like:
$ git add *
$ git status
On branch master
Changes to be committed:
(use &
For your 1st question "What is git-restore?":
git-restore is a tool to revert non-commited changes. Non-commited changes are: a) changes in your working copy, or b) content in your index (a.k.a. staging area).
This command was introduced in git 2.23 (together with the git-switch) to separate multiple concerns previously united in git-checkout.
git-restore can be used in three different modes, depending on whether you like to revert work in the working copy, in the index, or both.
git restore [--worktree] overwrites --worktree or not does not matter because it is implied if you don't say otherwise.
git restore --staged overwrites git reset HEAD .
To overwrite both, the working copy and the index with the current HEAD, use git restore --staged --worktree --source HEAD . This version does both: revert your working copy to HEAD and unstage previously staged work.
For your 2nd question "What's the difference between git-restore and git-reset?":
There are overlaps between these two commands, and differences.
Both can be used to modify your working copy and/or the staging area. However, only git-reset can modify your repository. In this sense, git-restore seems the safer option if you only want to revert local work.
There are more differences, which I can't enumerate here.
(*) A file not added to the index is still regarded to be in the index, however in it's "clean" state from the current HEAD revision.