kubectl 5,150 rollout undo copies an older ReplicaSet's template, and its annotations, back into the Deployment, which rolls to it like any change; nothing is rebuilt:
kubectl rollout undo deployment/api --to-revision=1
kubectl rollout status deployment/api >/dev/null
kubectl get deployment api -o jsonpath='{..image}{"\n"}' && kubectl rollout history deployment/apiOutput
Warning: resource deployments/api was previously managed with 'kubectl apply'. Rolling back will not update the kubectl.kubernetes.io/last-applied-configuration annotation, ... deployment.apps/api rolled back localhost:33500/booknest-api:1.3 deployment.apps/api REVISION CHANGE-CAUSE 2 BookNest API 1.4 3 BookNest API 1.4
Revision 3 runs 1.3 but is labeled 1.4. The controller copies the Deployment's annotations onto its current ReplicaSet, so Rolling Updates's annotate, run before set image, had relabeled revision 1 too. Change both in one apply (Deploying the API), or annotate after the change. The warning names a bigger trap: the file in Git 1,932 still holds the version you fled, and the next apply or GitOps sync (GitOps with Argo CD) brings it back. revisionHistoryLimit (default 10) bounds how far back you can go.