Restore an earlier version

List the versions and delete markers of a versioned bucket, make an older version current again, undelete an object, or delete one version for good.

Last updated 18 November 2026View as Markdown

This works in a bucket with versioning on (see Turn on versioning). Replace example-uploads with your bucket's name, report.pdf with the object's key and 3HL4kqtJlcpXroDTDmJ-rmSpXd3dIbrHY with the version id.

Prerequisites

  • To list versions: s3:ListBucketVersions.
  • To download an older version: s3:GetObjectVersion.
  • To make a version current: s3:PutObject and s3:GetObjectVersion.
  • To delete a version or a delete marker for good: s3:DeleteObjectVersion.
  • In the console, also s3:GetBucket on the bucket to open it (without it the bucket's page says "Access denied").

List the versions

  1. Open the bucket, then choose Objects, and open the folder.
  2. Turn on Show versions. Each entry is marked Current, Older or Delete marker. Choose Show more for the next 200.

Make an older version current

  1. With Show versions on, open the older version's menu.
  2. Choose Make current.

The console says "report.pdf: the version of date is current again."

The version is copied over its key as a new latest version; the older version stays. Over S3, aws s3api copy-object with --copy-source example-uploads/report.pdf?versionId=… does the same.

Undelete an object

A delete in a versioned bucket adds a delete marker that hides the object. Removing the marker brings it back.

  1. With Show versions on, open the menu of the current Delete marker.
  2. Choose Undelete.

Delete one version for good

In the console, choose Delete this version for good in the version's menu, then Delete in the dialog Delete this version for good?. Over the CLI and API, delete-versions with that version's id, as above; up to 1000 versions per call. Without s3:DeleteObjectVersion on any one of the keys, the whole request is refused with 403. Otherwise the answer lists what was deleted and, under errors, each version the bucket refused.

Download an older version

In the console, choose Download this version. Over the API, POST /s3/api/buckets/example-uploads/objects/download-url with key and versionId answers a URL valid for 15 minutes.

Did this page help you?