# helm rollback: Command Reference for CI/CD

> Reference for helm rollback: revert a release to a previous revision, find the target with helm history, the --wait flag, and a CI auto-rollback example.

Source: https://latchkey.dev/learn/command-reference/helm-rollback-command-cli-reference  
Updated: 2026-06-26

Revert a release to a known-good revision.

helm rollback reverts a release to an earlier revision recorded in its history. With --atomic on upgrade it usually happens automatically, but explicit rollback is the manual escape hatch. This reference covers it and helm history.

## Common flags and usage

- rollback <release>: revert to the immediately previous revision
- rollback <release> <revision>: revert to a specific revision number
- helm history <release>: list revisions to pick a target
- --wait: block until the rolled-back release is Ready
- --timeout 5m: bound the wait

## Example

```shell
helm history web --namespace prod
helm rollback web 4 --namespace prod --wait --timeout 5m
```

## In CI

When you cannot use --atomic (for example a multi-step deploy), wire helm rollback into the failure branch. Read helm history to choose the target revision; a rollback itself creates a new revision, so the history grows forward rather than rewinding.

## Using this in CI

A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.

```Terminal
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods

# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info

# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodes
```

> Always set `--request-timeout` in CI. Without it an unreachable API server hangs until the job times out, which turns a thirty-second failure into a twenty-minute one.

## FAQ

### helm rollback: Command Reference for CI/CD?

helm rollback reverts a release to an earlier revision recorded in its history. With --atomic on upgrade it usually happens automatically, but explicit rollback is the manual escape hatch. This reference covers it and helm history.

### In CI?

When you cannot use --atomic (for example a multi-step deploy), wire helm rollback into the failure branch. Read helm history to choose the target revision; a rollback itself creates a new revision, so the history grows forward rather than rewinding.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
