Undeleting a File

Scenarios

If a bucket has the versioning function enabled, you can restore a deleted object through the Undelete operation.

Background Information

Object deletion mechanism when versioning is enabled

When versioning is enabled, OBS uses different deletion methods for different objects.

Object recovery mechanism when versioning is 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 a deleted object by the Undelete operation.

When performing the Undelete operation, note the following points:

  1. You can only undelete deleted files 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 have multiple versions. When deleting different versions of files, note the following points:
    • If you delete a version with the Delete Marker, it actually recovers that specific version instead of permanently deleting it. For details, see Follow-up Procedure.
    • If you delete a version without the Delete Marker, that specific version is deleted permanently. Even if the object is recovered later, this version will not be recovered.
  3. At least one version without the Delete Marker exists in the Deleted Objects list. Otherwise, the deletion cannot be canceled.

Prerequisites

Procedure

  1. In the bucket list, click the bucket to be operated. The Overview page of the bucket is displayed.
  2. In the navigation pane, click Objects.
  3. Click Deleted Objects.
  4. 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.

Follow-up Procedure

Recover a file by deleting its version with the Delete Marker:

  1. In the bucket list, click the bucket to be operated. The Overview page of the bucket is displayed.
  2. In the navigation pane, click Objects.
  3. Click Deleted Objects.
  4. Click the deleted file that you want to recover. The file information is displayed.
  5. On the Versions tab, view all versions of the file.

    • If you delete a version with the Delete Marker, the file is recovered and will appear in the Objects list.
    • If you delete a version without the Delete Marker, that version is permanently deleted.