# Rollback

> Put the last version that worked back after a bad deploy.

**Field:** Software Development  
**Category:** DevOps & Cloud  
**Also known as:** Roll Back, Revert Deployment, Rollback Deployment

## Think of it like

Think of it like the undo button on a drawing app. One press, and the last change is gone.

## Definition

A rollback puts the previous working version back after a bad deploy. Instead of fixing the bug while users suffer, you return to what worked. Then you fix the bug calmly and ship again. A good rollback takes one command and a minute or two. It only works if the old build is still saved and the data still fits it.

## Example

Jack's new release doubles the error rate. He runs one command, the old version is back in 40 seconds, and he fixes the bug after lunch.

## Example code

```console
$ kubectl rollout undo deployment/web
deployment.apps/web rolled back
```

One command puts the web app back on its last version.

## Why it matters

Fast undo makes shipping less scary. Teams that can roll back in a minute are happy to deploy often.

## Common mistake

Never practising a rollback. The first time you try it is during an outage, and it does not work.

## Three principles

- **Back to what worked.** Then fix calmly.
- **One command.** A minute or two.
- **Keep old builds.** Or there is nothing to go back to.

## Related terms

- [Deployment (Software)](https://learn.benibix.com/term/development/deployment)
- [Build Artifact](https://learn.benibix.com/term/development/build-artifact)
- [Blue-Green Deployment](https://learn.benibix.com/term/development/blue-green-deployment)
- [Hotfix](https://learn.benibix.com/term/development/hotfix)
- [Git Revert](https://learn.benibix.com/term/development/git-revert)

## Told apart from

- [Rollback vs Hotfix](https://learn.benibix.com/compare/rollback-vs-hotfix): A rollback and a hotfix both deal with a bad change in the live app, in opposite ways. A rollback goes back to the last version that worked, often in a minute. A hotfix goes forward with a new version that fixes the bug. Roll back first to stop the harm, then ship the hotfix calmly.
- [Feature Flag vs Rollback](https://learn.benibix.com/compare/feature-flag-vs-rollback): People think turning off a feature flag is a rollback, and it is not. A rollback puts the whole last version back on the servers, which takes a minute or two. Turning off a flag hides one feature in seconds and leaves the rest of the deploy in place. Use the flag when one feature is the problem, and roll back when the whole deploy is.

---

Source: https://learn.benibix.com/term/development/rollback
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
