How to rollback to previous version in Amazon S3 bucket?

Question:

I upload folders/files by:

Is there a way to return/rollback to previous version?

Like git revert or something similar?

UPDATE:
here the is test file that I uploaded 4 times.

How to get to previous version (make it the “Latest version”)

For example make this “Jan 17, 2018 12:48:13” or “Jan 17, 2018 12:24:30”
to become the “Latest version” not in gui but by using command line?
enter image description here

Answer:

Here is how to get that done:

If you are using cli,

https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html

Get the object with the version you want.

Then perform a put object for the downloaded object.

https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html

Your old S3 object will be the latest object now.

AWS S3 object is immutable and you can only put and delete. Rename is GET and PUT of the same object with a different name.

Hope it helps.

Leave a Reply