> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.zata.prathamchopde.site/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.zata.prathamchopde.site/_mcp/server.

# Delete and restore files

What happens when you delete a file depends on the bucket's [versioning](/buckets/bucket-settings#versioning-management):

| Versioning                       | What **Delete** does                                              | Can you get the file back?         |
| -------------------------------- | ----------------------------------------------------------------- | ---------------------------------- |
| Never turned on                  | Removes the file for good                                         | No                                 |
| On, or turned off after being on | Hides the file behind a **delete marker**. Its versions are kept. | Yes, by removing the delete marker |

## Delete a file

#### Open the file's menu

In the bucket, open the **⋮** menu in the file's row and select **Delete**.

#### Confirm

In **Delete File**, select **Delete**.

![The Delete File window asking to confirm removal of a file](/_fern-img/f343a9e7cfc7f50de23dcf66fc6dd11f41680f4db57c16f21be995439e4e6845.webp)

To delete a folder and everything in it, select **Delete** in the folder's **⋮** menu, then **Delete Folder**.

> **Warning**
>
> If **Show Versions** is on when you delete a folder, the console deletes every version of every file in it, permanently. With **Show Versions** off, the files can still be restored.

## Restore a deleted file

This works when versioning is or was on.

#### Show versions

In the bucket, turn on **Show Versions**. The deleted file appears with a row of type **Delete Marker** above its older versions.

![Show Versions turned on, listing a Delete Marker above the file's previous version](/_fern-img/312fa43e120852b245f9475775823c4841f7cc1859bfc6c411bb02da6d9ec30d.webp)

#### Remove the delete marker

Open the **⋮** menu of the **Delete Marker** row and select **Remove Marker**. Confirm with **Remove Marker**.

![The Delete Marker row with its menu open showing Remove Marker](/_fern-img/9b24438434478901cf6feb3adc6b7300a5e64671b6f441f2f019a4e23f939f87.webp)

The file is back in the file list as its newest version.

## Go back to an older version

With **Show Versions** on, every version has its own **⋮** menu with **Share**, **Download** and **Delete**. To use an older version again, either:

* **Download** it and upload it again, so it becomes the newest version, or
* **Delete** the newer versions. The newest remaining version becomes the current file.

## Delete a version for good

With **Show Versions** on, open the **⋮** menu of a version, select **Delete** and confirm. This removes that one version permanently.

Old versions and delete markers use storage until you delete them. To clean them up automatically, add a [lifecycle rule](/buckets/lifecycle-rules) with **Clear old versions** and **Tidy delete markers**.

> **Note**
>
> In a bucket with [Object Lock](/buckets/object-lock/overview), a locked version cannot be deleted until its lock ends.