Interview Prep/Git & GitHub/Undoing changes: reset, revert, restore and reflog

What does `git checkout -- .` or `git restore .` do?

BeginnerConceptUndoing changes: reset, revert, restore and reflog
Answer

It overwrites all tracked modified files in the working tree with the index version, losing unstaged edits irreversibly. It does not touch untracked files and it does not touch staged content unless --staged is given.

All Git & GitHub questions Roadmap: Git & GitHub

More on Undoing changes: reset, revert, restore and reflog