Git reset is not just another command. For Site Reliability Engineering, it’s a weapon. When code history moves forward but reality demands rollback, git reset clears the path. It rewrites HEAD, staging, and working trees. It cuts commits from history or shifts them to a safe branch. In high-pressure environments, the difference between --soft, --mixed, and --hard can decide whether a service stays online or burns.
Understanding the variants:
git reset --soft <commit>keeps changes in staging. Useful when reverting a bad merge without losing prepared fixes.git reset --mixed <commit>(default) keeps changes in your working directory but un-stages them. Good for reorganizing commits before release.git reset --hard <commit>wipes everything. The fastest way to restore a clean state, but dangerous if not backed up.
For an SRE team, the command is often applied in incident response workflows: