Git Discard File Changes
(Updated: )
Discard uncommitted changes for a specific file.
bash
$git restore <filename>
$# Or
$git checkout -- <filename>
Discard uncommitted changes for the current directory.
bash
$git restore .
$# Or
$git checkout -- .
A blog about programming, Web development, Open Source, Linux and DevOps.
Discard uncommitted changes for a specific file.
$git restore <filename>
$# Or
$git checkout -- <filename>
Discard uncommitted changes for the current directory.
$git restore .
$# Or
$git checkout -- .