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.
More on Undoing changes: reset, revert, restore and reflog
What are the three modes of `git reset`?BeginnerWhat is the difference between `git reset` and `git revert`?BeginnerHow do you discard changes in one file?BeginnerHow do you recover a commit after `git reset --hard`?IntermediateCan you recover uncommitted changes lost by `git reset --hard` or `git checkout .`?IntermediateWhat does `git commit --amend` do to the reflog and to the old commit?Intermediate