When would you use git restore instead of git reset?
Use git restore to change files, either discarding edits or unstaging a path. Use git reset to move the branch pointer to another commit. Restore never moves your branch.
Explain it simply
Both can unstage a file, which causes confusion. The real difference is the target. git reset is about the branch: move it to another commit. git restore is about files: bring them back to a known state.
If you only want to fix one file, git restore --staged file unstages it and git restore file discards its edits. If you want to remove or rework a commit, that is reset or revert. Restore is more predictable for beginners, since it cannot accidentally rewind commits.
Example
git restore --staged index.html # unstage one file
git restore index.html # discard its edits
git reset --soft HEAD~1 # rewind a commitWhat to say in the interview
"restore works on files in the working tree or index, and reset moves the branch tip, optionally changing the index and working tree. For fixing a single file I use restore, and for rewriting commits I use reset or revert."