← Learn
Dangerous
git checkout .

cross-platform · bash · Beginner

Restores every tracked file in the working tree from the index, throwing away all uncommitted edits. checkout normally means switching branches, which is why this form catches people out.

Signals to notice

  • uncommitted changes to tracked files are discarded with no prompt
  • there is no reflog entry for working tree edits, so nothing can recover them

Think you can spot these under time pressure?

Start Training

More Git / Development