git/restore

Restore Files

Restore working tree files (Git 2.23+)

git
restore
files

Command

git restore

Explanation

git restore is used to restore working tree files (Git 2.23+). It restores the working tree files (Git 2.23+).

Examples

Discard unstaged changes

git restore file.txt

Unstage file

git restore --staged file.txt