Undeleting an Object

Scenarios

If a bucket has versioning enabled, you can recover a deleted object by undeleting it.

Background Information

Object Deletion with Versioning Enabled

When versioning is enabled for a bucket, OBS works slightly different when deleting different objects.

  • Deleting a file or folder: The file or folder is not permanently deleted, but is retained in the Deleted Objects list and marked with the Delete Marker.

    • To permanently delete the file or folder, delete it again from the Deleted Objects list. For details, see Deleting an Object or Folder.

    • To recover the deleted file, undelete it from the Deleted Objects list. For details, see Procedure.

  • Deleting an object version: The version will be permanently deleted and cannot be recovered. If the deleted version is the latest one, the next latest version becomes the latest version.

Object Recovery with Versioning Enabled

When a bucket has the versioning function enabled, deleting a file from the Objects list does not permanently delete it. The deleted file will be retained with the Delete Marker in the Deleted Objects list. You can recover the deleted file using the Undelete operation.

Note the following points when you undelete objects:

  1. Only files can be undeleted but not folders.

    After you undelete a deleted file, the file is recovered and will appear in the Objects list. Then you can perform basic operations on the file as you normally do on other objects. If the file was stored in a folder before the deletion, it will be recovered to its original path after you undelete it.

  2. Deleted files in the Deleted Objects also keep multiple versions. When deleting different versions of files, note the following points:

    • If you delete a version with the Delete Marker, it actually recovers this version instead of permanently deleting it. For details, see Related Operations.

    • If you delete a version without the Delete Marker, that version is permanently deleted. This version will not be recovered, even if the object is recovered later.

  3. A deleted object must have at least one version without the Delete Marker in the Deleted Objects list. Otherwise, the object cannot be undeleted.

Prerequisites

  • Versioning has been enabled for the bucket. For details, see Configuring Versioning.

  • The file to be recovered is in the Deleted Objects list, and has at least one version without the Delete Marker.

Procedure

  1. In the bucket list, click the bucket you want to operate to go to the Objects page.

  2. Click Deleted Objects.

  3. In the row of the deleted object that you want to recover, click Undelete on the right.

    You can select multiple files and click Undelete above the object list to batch recover them.