1 Easy way to retrieve an Amazon S3 object that was deleted in a versioning-enabled bucket?

OOPS! By mistake, you have deleted the object from s3 in the production environment. How to retrieve it?

First, let’s understand how Amazon S3 works… When you delete an object from a version-enabled bucket, Amazon S3 creates a delete marker for the object. The delete marker becomes the current version of the object, and the actual object becomes the previous version. With a delete marker, Amazon S3 responds to requests for the object as though the object was deleted. For example, if you send a GET request for the object, Amazon S3 returns an error.

what to do now?

Let’s modify the below script according to your file path and run it!!!

We’re a proud AWS partner. Read all about our AWS practices

--

--