• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense Keys
DeployingPackagingBuildingTestingDev ModeServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
LayersManaged InstancesWeb Apps (Lambda Web Functions)Sandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
OverviewConcepts
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. CLI Reference
  2. Rollback

serverless rollback

serverless rollback returns a service's CloudFormation stack to an earlier deployment that is still stored in the deployment bucket: its template and its code packages. Use it to undo a deployment of the whole service. To restore only one function's code from a Lambda version, use serverless rollback function.

serverless rollback --timestamp 1793178942120

Take the timestamp from serverless deploy list. Without --timestamp, serverless rollback prints the same list and changes nothing.

Options

serverless rollback accepts these options:

OptionAliasValueDefaultRequiredDescription
--timestamp-tstringnoneNoDeployment to restore: the Timestamp that serverless deploy list prints, or a date string of the same moment. Without it, the command lists the deployments.
--stage-sstringprovider.stage, else devNoStage to roll back.
--region-rstringprovider.region, else us-east-1NoAWS Region of that stage.
--aws-profilestringprovider.profileNoAWS profile whose credentials the command uses.
--config-cfile pathserverless.ymlNoService configuration file to use.
--verboseflagoffNoPrint each CloudFormation stack event during the rollback.

serverless rollback also accepts the options every command takes: --param="key=value" (repeatable), --org, --app, --debug and --help (-h).

What serverless rollback changes in AWS

serverless rollback --timestamp <timestamp> finds the deployment folder for that timestamp under <deploymentPrefix>/<service>/<stage>/ in the deployment bucket, then updates the stack with the template stored there, directly or through a change set as provider.deploymentMethod sets. CloudFormation then changes every resource that differs, including function code, which the stored template points to in the same folder. The command waits for the update to finish.

Run the command from the service directory: it reads the service name, stage and deployment prefix from serverless.yml. It uploads nothing and creates no deployment folder.

Only deployments still in the bucket can be restored. serverless deploy keeps the newest provider.deploymentBucket.maxPreviousDeploymentArtifacts (default 5). When the timestamp matches none of them, the command stops with:

Couldn't find a deployment for the timestamp: 1793178942120. Please verify that the timestamp, stage and region are correct.

When the stack already matches that deployment, the command prints No updates to be performed. Rollback skipped. and changes nothing, so it is safe to re-run.

Deploy again after serverless rollback

serverless deploy compares the local package with the newest deployment in the bucket, not with the deployment the stack runs after a rollback. When your files still match that newest deployment, the next serverless deploy is skipped with No changes to deploy. Deployment skipped.; run serverless deploy --force to deploy them.

Run serverless rollback in CI

serverless rollback has no prompts of its own. In CI, always pass --timestamp, --stage and --region, and sign in with SERVERLESS_ACCESS_KEY or SERVERLESS_LICENSE_KEY; see Non-interactive use.

Output of serverless rollback

Rolling back my-service to timestamp "1793178942120"

✔ Service rolled back to timestamp "1793178942120" (32s)

Provided lifecycle events

  • rollback:initialize
  • rollback:rollback

Examples

Find a deployment and roll back to it

List the stored deployments:

serverless deploy list

The list shows each deployment's date in UTC and its timestamp:

2026-10-28 09:15:42 UTC
Timestamp: 1793178942120
Files:
  - compiled-cloudformation-template.json
  - my-service.zip
  - serverless-state.json

2026-10-30 14:02:11 UTC
Timestamp: 1793368931482
Files:
  - compiled-cloudformation-template.json
  - my-service.zip
  - serverless-state.json

Roll back to the deployment of October 28:

serverless rollback --timestamp 1793178942120

Roll back a specific stage

serverless rollback --timestamp 1793178942120 --stage prod --region eu-central-1

Related commands

  • serverless deploy list lists the deployments you can roll back to.
  • serverless rollback function restores one function's code from a Lambda version.
  • serverless deploy deploys the current serverless.yml again.
Edit this page
Prev removeNextrollback function

Contents

  • serverless rollback
  • Options
  • What serverless rollback changes in AWS
  • Deploy again after serverless rollback
  • Run serverless rollback in CI
  • Output of serverless rollback
  • Provided lifecycle events
  • Examples
  • Find a deployment and roll back to it
  • Roll back a specific stage
  • Related commands

Related

GuidesPluginsExamplesSlack CommunitySupport