Git has no undo command, so what safety net do you set up for a team?
IntermediateConceptUndoing changes: reset, revert, restore and reflog
Answer
<details> <summary><b>Answer</b></summary>
Git has no undo command; safety comes from habits: commit often, push backup branches, enable rerere, and know the reflog. Use --force-with-lease and protected branches so history rewriting is limited to private branches, and set gc.reflogExpire generously on developer machines.
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