When you update a service in swarm mode, the swarm stores the configuration of the previous deployment. If you find a problem with the release, you can roll back to the previous state with a single command:
> docker service update --rollback nerd-dinner_nerd-dinner-homepage
nerd-dinner_nerd-dinner-homepage
The rollback is a specialized form of service update. Instead of passing an image name for tasks to update to, the rollback flag does a rolling update to the previous image used by the service. Again, the rollback happens one task at a time, so this is a zero-downtime process. You can use this command to rollback to, no matter how you applied the update—whether you used docker stack deploy or docker service update.
Service updates retain only one prior service configuration for rollbacks. If you update from version 1 to version 2 and then to version 3, the configuration of version 1 is lost. You can roll back from version 3 to version 2—but if you roll back again from version 2, it will be to the previous version, which will take you in a circle back to version 3.