Mid
From PDF
Version Control
Git & GitHub
How would you roll back a production release using Git?
Short answer: There are several safe rollback methods: Option 1 — Revert to a previous tag (recommended): git revert <commit-hash> git push origin main This creates a new commit that undoes the bad release. Option 2 — Deploy a stable tag: git checkout v1.2.3 git push origin main --force
Example code
If version v2.0 introduced a bug in the payment flow, I revert to v1.9.1 (the last stable tag) and redeploy while investigating the issue. In CI/CD pipelines: We often have a ROLLBACK_TAG variable that can deploy a known safe version automatically.
Real-world example (ShopNest)
ShopNest’s team uses GitHub PRs with reviews and CI checks so broken builds never reach production unnoticed.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png