In brief
git restore restores selected paths in the working tree or index. With --staged, the default source is HEAD; otherwise, working files normally use the index as their source.
Useful to know
git restore restores selected paths in the working tree or index. With --staged, the default source is HEAD; otherwise, working files normally use the index as their source. [1]
These modes are not interchangeable. Inspect the diff and establish which contents must survive. Restore can replace an uncommitted edit; it is not merely another way to display an old version.
Sources
For further detail and to check the information: