kubectl rollout undo deployment/<name>
kubectl rollout undo deployment/<name> [--to-revision=n]
Risk: Careful
What it does
Goes back to the previous pod template, with a rolling update.
When to use it
A new version is broken: undo fast, then fix calmly.
Example
$ kubectl rollout undo deployment/shopBack to the last good version.
Learn it in: Rolling updates and rollout undo · Official docs