<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr" -->

---
title: How to Rollback a Deployment in Kubernetes | daily.dev
description: An explanation of how Kubernetes Deployments manage rollbacks through ReplicaSets, covering rolling updates, revision history, the kubectl rollout undo and...
canonical: https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Rollback a Deployment in Kubernetes | daily.dev
og:description: An explanation of how Kubernetes Deployments manage rollbacks through ReplicaSets, covering rolling updates, revision history, the kubectl rollout undo and...
og:url: https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr
og:image: https://api.daily.dev/og/posts/v4MlXxiwr.png
og:image:alt: How to Rollback a Deployment in Kubernetes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Rollback a Deployment in Kubernetes

**[LearnKube](https://daily.dev/sources/learnkube)** · 14 min read · 0 upvotes · 0 comments

## Summary

An explanation of how Kubernetes Deployments manage rollbacks through ReplicaSets, covering rolling updates, revision history, the kubectl rollout undo and rollout restart commands, progressDeadlineSeconds for detecting failed rollouts, and why rolling forward via version control is recommended over relying on kubectl rollback commands, which the author advises treating as deprecated in favor of setting revisionHistoryLimit to zero.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://learnkube.com/kubernetes-rollbacks>

## Questions this post answers

### How do I roll back a Kubernetes Deployment to a specific revision?

Use kubectl rollout undo deployment/app --to-revision=2 to roll back to a specific revision. Kubernetes finds the ReplicaSet matching that revision number, gradually scales it up while scaling down the current ReplicaSet, and then updates the revision annotation, promoting the old revision number to a new one (e.g., revision 2 becomes revision 4).

_Track kubectl rollout and Deployment changes as you plan production rollback strategies with daily.dev._

### Why is the Change-Cause column always blank when I run kubectl rollout history?

The Change-Cause column stays empty because it only populates from the kubernetes.io/change-cause annotation on the Deployment, which must be set manually with a command like kubectl annotate deployment/app kubernetes.io/change-cause="message". The old --record flag that used to set this automatically was deprecated and later removed in Kubernetes versions before 1.25.

_Developers debugging deployment history gaps can follow Kubernetes annotation changes on daily.dev._

### Should I use kubectl rollout undo to fix a production regression?

It is not recommended as the primary fix because it creates drift between the cluster state and version control, so a colleague deploying from version control afterward could reintroduce the regression. The better alternative is to roll forward by reverting the change in deployment.yaml through version control and triggering a new deployment, treating kubectl rollout undo as a deprecated, emergency-only tool.

_Teams weighing rollback versus roll-forward strategies can compare approaches on daily.dev._

## Similar posts on daily.dev

- [Kubernetes Rolling Updates for Reliable Deployments](https://daily.dev/posts/kubernetes-rolling-updates-for-reliable-deployments-oiniknzlc) · Spacelift · 3 upvotes · 0 comments
- [A guide to restarting pods in Kubernetes using kubectl](https://daily.dev/posts/a-guide-to-restarting-pods-in-kubernetes-using-kubectl-vramfbhhs) · CNCF · 1 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#kubernetes](https://daily.dev/tags/kubernetes), [#cicd](https://daily.dev/tags/cicd)

[View this post on daily.dev](https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Rollback a Deployment in Kubernetes","url":"https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr"},"datePublished":"2026-08-31T11:20:04.111Z","dateModified":"2026-08-31T11:20:43.118Z","description":"An explanation of how Kubernetes Deployments manage rollbacks through ReplicaSets, covering rolling updates, revision history, the kubectl rollout undo and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a1c02e8c28958c3f6ac95437d9a07707?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a1c02e8c28958c3f6ac95437d9a07707?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"LearnKube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"LearnKube","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/90786df1b5d44abb91a090a0b6c81517","url":"https://daily.dev/sources/learnkube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,kubernetes,cicd","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"LearnKube","item":"https://daily.dev/sources/learnkube"},{"@type":"ListItem","position":3,"name":"How to Rollback a Deployment in Kubernetes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-rollback-a-deployment-in-kubernetes-v4mlxxiwr#faq","mainEntity":[{"@type":"Question","name":"How do I roll back a Kubernetes Deployment to a specific revision?","acceptedAnswer":{"@type":"Answer","text":"Use kubectl rollout undo deployment/app --to-revision=2 to roll back to a specific revision. Kubernetes finds the ReplicaSet matching that revision number, gradually scales it up while scaling down the current ReplicaSet, and then updates the revision annotation, promoting the old revision number to a new one (e.g., revision 2 becomes revision 4). Track kubectl rollout and Deployment changes as you plan production rollback strategies with daily.dev."}},{"@type":"Question","name":"Why is the Change-Cause column always blank when I run kubectl rollout history?","acceptedAnswer":{"@type":"Answer","text":"The Change-Cause column stays empty because it only populates from the kubernetes.io/change-cause annotation on the Deployment, which must be set manually with a command like kubectl annotate deployment/app kubernetes.io/change-cause=\"message\". The old --record flag that used to set this automatically was deprecated and later removed in Kubernetes versions before 1.25. Developers debugging deployment history gaps can follow Kubernetes annotation changes on daily.dev."}},{"@type":"Question","name":"Should I use kubectl rollout undo to fix a production regression?","acceptedAnswer":{"@type":"Answer","text":"It is not recommended as the primary fix because it creates drift between the cluster state and version control, so a colleague deploying from version control afterward could reintroduce the regression. The better alternative is to roll forward by reverting the change in deployment.yaml through version control and triggering a new deployment, treating kubectl rollout undo as a deprecated, emergency-only tool. Teams weighing rollback versus roll-forward strategies can compare approaches on daily.dev."}}]}
```

