TExcelTAD
Home › Release Engineering & CI/CD › Rollbacks & Roll-forward

Rollbacks & Roll-forward

Every release process needs an answer to "1.5.0 is broken in production, what now?" written down before it happens. There are two directions: roll back to the previous good version, or roll forward with a fix as a new version. Which one is possible depends on decisions made long before the incident.

The options

Option How Speed Works when
Turn off the flag lower the rollout to 0% seconds the bad change was behind a feature flag
Redeploy the previous artifact deploy 1.4.2 again (old image digest, old package) minutes old artifacts are kept, and data/schema is still compatible
Traffic switch (blue-green, canary) send traffic back to the old fleet seconds the old version is still running next to the new one
Roll forward revert or fix on main, release 1.5.1 the length of your pipeline always, if the pipeline is fast
Yank / deprecate npm deprecate, cargo yank, PyPI yank, hide a GitHub Release minutes libraries: stop new installs of the bad version

Two rules hold for all of them:

  • Never re-release a version number. "Roll back" means deploying an older artifact or publishing a newer version, never moving the 1.5.0 tag or re-uploading 1.5.0 (Annotated vs Lightweight Tags).
  • You can only roll back to artifacts you still have. Keep previous release artifacts and image digests (retention policies on registries can delete them), and make sure the deploy tool can deploy an arbitrary old version.

Roll forward with a revert

For code you ship as releases (libraries, CLIs, apps), rolling forward is the standard path: revert the bad commit on main and let the normal pipeline release a patch version. One detail breaks automation: git revert writes the message Revert "…", which is not a Conventional Commit. The session shows the effect and the fix:

bash · try it yourself
git init -q --bare remote.git
git clone -q remote.git app 2>/dev/null && cd app
git-cliff --init >/dev/null 2>&1 && git add cliff.toml
echo "timeout=30" > config.txt && git add config.txt
git commit -q -m "feat: configurable timeout" && git tag -a v1.4.2 -m "v1.4.2"
echo "timeout=0" > config.txt
git commit -q -am "perf: disable the timeout for faster startup"
git tag -a v1.5.0 -m "v1.5.0" && git push -q origin main v1.4.2 v1.5.0
echo "--- 1.5.0 hangs in production. Roll forward:"
bad=$(git rev-parse --short HEAD)
git revert --no-edit HEAD >/dev/null
git log -1 --format=%s
echo "next version with git's default message: $(git-cliff --bumped-version 2>/dev/null)"
git commit -q --amend -m "revert: disable the timeout for faster startup" -m "Refs: $bad"
echo "next version with a conventional message: $(git-cliff --bumped-version 2>/dev/null)"
next=$(git-cliff --bumped-version 2>/dev/null)
git tag -a "$next" -m "$next" && git push -q origin main "$next"
cat config.txt
git log --oneline --decorate
git-cliff --latest --strip all 2>/dev/null
--- 1.5.0 hangs in production. Roll forward:
Revert "perf: disable the timeout for faster startup"
next version with git's default message: v1.5.0
next version with a conventional message: v1.5.1
timeout=30
ce098a6 (HEAD -> main, tag: v1.5.1, origin/main) revert: disable the timeout for faster startup
2d9ebc6 (tag: v1.5.0) perf: disable the timeout for faster startup
c64fde8 (tag: v1.4.2) feat: configurable timeout
## [1.5.1] - 2026-01-15

### ◀️ Revert

- Disable the timeout for faster startup

With git's default message, git-cliff found nothing to release (it printed the current version, v1.5.0). Rewritten as revert: … with a Refs: footer, the form the Conventional Commits specification suggests, it counts as a patch and lands in the changelog's Revert section. Tools differ here: semantic-release's default preset does recognise git's Revert "…" format (and releases a patch), and commitlint ignores such messages by default, so the problem only shows up with some tools. Writing revert: works with all of them.

The history keeps everything: the bad release, the revert, and the fixed release. Anyone with 1.5.0 installed sees that 1.5.1 exists and what it fixed. Compare that with deleting the tag: users who already pulled 1.5.0 would have no way to know.

When a rollback isn't possible

The previous artifact is only safe to redeploy if nothing else moved forward with the release:

  • Database migrations. If 1.5.0 dropped a column, 1.4.2 can't run against the new schema. The fix is the expand/contract pattern: release N adds the new column and writes both; release N+1 reads the new one; only release N+2 drops the old one. Every release stays compatible with the previous version's schema, so rolling back one version is always possible.
  • Data written in a new format. Configs, caches, save files, queue messages: the old version must at least ignore what the new one writes ("be liberal in what you accept").
  • Installed client apps. You can't uninstall 1.5.0 from users' phones. Remote kill switches and server-side compatibility for the last few app versions are the only tools.
  • Published libraries. A yank prevents new resolutions, but lockfiles already pointing at 1.5.0 keep it. Release 1.5.1 and say clearly in its notes what was wrong.

Deployment strategies that make rollback cheap

Strategy How it works Rollback
Rolling replace instances a few at a time roll the old version back out (minutes)
Blue-green full new fleet next to the old one; switch traffic at once switch traffic back (seconds); costs double capacity during the switch
Canary send 1% → 10% → … of traffic to the new version, watch metrics stop the canary; most users never saw it
Feature-flag rollout same binary everywhere, feature enabled progressively flag off

Kubernetes implements rolling updates natively (kubectl rollout undo redeploys the previous ReplicaSet), and service meshes and progressive-delivery controllers add canaries with automatic metric checks.

A rollback runbook

Write it before you need it, keep it next to the release checklist (Release Trains & Checklists), and rehearse it:

  1. Decide fast. Who can call a rollback? (Anyone on call. Debating comes later.)
  2. Stop the bleeding: flag off, traffic back, or redeploy the last good version: commands written down, with the place to find the last good version.
  3. Stop the pipeline from re-releasing the bad version (pause auto-deploy).
  4. Communicate: status page, release notes ("1.5.0 was withdrawn"), yank or deprecate.
  5. Roll forward with a tested fix as a new version.
  6. Post-incident review: which gate should have caught it?

Test yourself

Version 1.5.0 of a CLI is broken. What should the published versions look like afterwards?

  1. 1.5.0 deleted and re-released with the fix
  2. 1.5.0 kept (possibly marked bad) and 1.5.1 released with the fix
  3. 1.4.2 renamed to 1.5.0
  4. Only 1.4.2

Why might redeploying 1.4.2 fail after 1.5.0 ran a database migration?

  1. Old images are deleted automatically
  2. 1.5.0 may have changed the schema in a way 1.4.2 can't read; expand/contract migrations avoid this
  3. Kubernetes forbids downgrades
  4. Git tags prevent it

git revert wrote the message Revert "perf: ...". Why reword it to revert: ...?

  1. Git requires lowercase
  2. Not every tool parses git's default revert format (git-cliff didn't); revert: is understood by all of them
  3. To trigger a major release
  4. To delete the bad tag