Maven / GitOps Interview Questions
How do you roll back a deployment using GitOps?
In GitOps, a rollback is not a special out-of-band operation — it is just another change to the Git repository. The same reconciliation loop that applies new versions applies the rollback. This preserves the audit trail and keeps the single source of truth intact.
Method 1 — git revert (preferred): Create a new commit that reverses the problematic change. The commit appears in history, clearly documenting when the rollback happened and why. This is always safe on protected branches.
git revert abc1234 # creates a new "revert" commit
git push origin main # triggers the GitOps operator to sync back to the previous state
Method 2 — git reset (emergency, use with caution): Hard-resets the branch to a known-good commit and force-pushes. Rewrites history. Use only when the problematic commit must be expunged from the record.
git reset --hard v1.4.9-tag
git push --force-with-lease origin main
Method 3 — Argo CD history rollback (without touching Git): Argo CD stores the last N sync revisions. You can roll back to any of them via UI (Application → History and Rollback) or CLI. This does not revert the Git branch — the Application will show OutOfSync against HEAD until you either reconcile or also revert Git.
# CLI rollback to history entry ID 3
argocd app rollback my-app 3
# Or pin the Application to a specific commit in its spec
spec:
source:
targetRevision: "abc1234def" # pinned to known-good SHA
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
