Amazon S3 versioning allows you to store multiple versions of an object in the same bucket. When versioning is enabled for a bucket, Amazon S3 stores all versions of an object (including all writes and deletes) in the bucket. This allows you to preserve, retrieve, and restore every version of every object in your bucket. To enable versioning for a bucket, you can use the Amazon S3 console, the AWS SDKs, or the Amazon S3 REST API. Once versioning is enabled, you can use the same tools to store, retrieve, and delete versions of objects in the bucket.
One important thing to note is that when you delete an object with versioning enabled, Amazon S3 stores a delete marker for the object, but does not actually delete the object. This means that the object is still stored in the bucket, but is not visible when you list the contents of the bucket. You can permanently delete an object by deleting all of its versions, including the delete marker. You can also use versioning to preserve objects during a bucket or object restore operation. When you restore an object, Amazon S3 creates a new version of the object that includes all of the data in the previous version, plus any additional writes or deletes that occurred during the restore process.