Command
git restoreExplanation
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.txtUnstage file
git restore --staged file.txtMore
Check Repository Status
git
Display the current state of your working directory and staging area, showing which files are modified, staged, or untracked
Switch Branches (New)
git
Switch branches (Git 2.23+)
Stash Changes
git
Temporarily save your uncommitted changes without committing them, allowing you to work on something else and restore them later