The deployment failed. Logs pointed to a bad commit. Instead of digging into mutable systems and hidden state, you run one command: git reset. Your infrastructure snaps back to a known baseline. No drift, no ghosts. This is the power of immutable infrastructure.
Immutable infrastructure means every change is a fresh build. Servers aren’t patched; they’re replaced. Config files aren’t edited live; they’re redefined in source control. When combined with versioned code, Git becomes the single source of truth. If something breaks, you reset to a commit that worked, redeploy, and restore full system integrity.
git reset in this context is not about cleaning up a developer’s local branch. It’s about hard-resetting the blueprint that provisions your infrastructure. You roll back to a commit ID that represents a complete working environment. Your pipelines rebuild from scratch. Your cloud resources are recreated exactly as before. There is no mystery data left over from past deployments.
This approach removes configuration drift. Drift happens when manual changes slip into systems after deployment. In mutable infrastructure, those changes stack up over time, making failures harder to diagnose. With immutable infrastructure and Git-driven deploys, the state is reproducible. Rollback is instant, forward deploy is predictable, and every artifact can be inspected by SHA.