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

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.

All Git & GitHub questions Roadmap: Git & GitHub

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