git restore

Restore working tree files. Requires Git version 2.23+. See also git checkout and git reset. More information: https://git-scm.com/docs/git-restore.

git restore {{path/to/file}}

git restore --source {{commit}} {{path/to/file}}

git restore :/

git restore --staged {{path/to/file}}

git restore --staged :/

git restore --worktree --staged :/

git restore --patch