| title | Recover deleted files |
|---|---|
| description | Learn how to use OneLake soft delete to recover accidentally deleted files and protect your data in Microsoft Fabric. |
| ms.author | kgremban |
| author | kgremban |
| ms.reviewer | eloldag |
| ms.topic | how-to |
| ms.custom | |
| ms.date | 02/03/2026 |
| ai-usage | ai-assisted |
OneLake automatically protects your data by using soft delete, which retains deleted files for seven days before permanent removal. This built-in protection helps you recover from accidental deletions or user errors without needing to restore from backups.
After seven days, soft-deleted files are permanently removed and can't be recovered.
You pay for soft-deleted data at the same rate as active data.
You can restore soft-deleted files by using Azure Storage Explorer, Azure PowerShell, or Azure Storage REST APIs. You need write access to the files to restore them.
Azure Storage Explorer provides a visual interface to browse and restore soft-deleted files.
To restore files by using Azure Storage Explorer, make sure you have:
- Azure Storage Explorer installed on your computer
- A connection to your OneLake workspace. For instructions, see Use Azure Storage Explorer with OneLake.
Use the following steps to restore files:
-
Open Azure Storage Explorer and connect to your OneLake workspace.
-
Go to the lakehouse or data item that contained the deleted files.
-
Select the dropdown button next to the path bar, and then select Active and soft deleted blobs instead of the default Active blobs.
-
Browse to the folder that contained the deleted file.
-
Right-click the soft-deleted file, and then select Undelete.
-
The file is restored to its original location and is immediately available.
Use Azure PowerShell to list and restore soft-deleted files programmatically.
To restore files by using PowerShell, make sure you have:
- Azure PowerShell Az.Storage module installed
- Authentication to OneLake. For instructions, see Connect to OneLake with PowerShell.
Use the following script to list soft-deleted files in a specific path:
# Connect to OneLake
$ctx = New-AzStorageContext -StorageAccountName "onelake" -UseConnectedAccount -endpoint "fabric.microsoft.com"
# List soft-deleted blobs in a container (workspace)
$workspaceName = "your-workspace-name"
$path = "your-lakehouse.Lakehouse/Files/"
Get-AzStorageBlob -Container $workspaceName -Context $ctx -Prefix $path -IncludeDeleted |
Where-Object { $_.IsDeleted } |
Select-Object Name, DeletedTime, RemainingDaysBeforePermanentDeleteUse the following script to restore a soft-deleted file:
# Connect to OneLake
$ctx = New-AzStorageContext -StorageAccountName "onelake" -UseConnectedAccount -endpoint "fabric.microsoft.com"
# Restore a specific blob
$workspaceName = "your-workspace-name"
$blobPath = "your-lakehouse.Lakehouse/Files/deleted-file.parquet"
Get-AzStorageBlob -Container $workspaceName -Context $ctx -Blob $blobPath -IncludeDeleted |
Where-Object { $_.IsDeleted } |
Restore-AzStorageBlobFor more PowerShell examples, see Restore soft-deleted blobs and directories by using PowerShell.
You can also restore soft-deleted files by using Azure Blob Storage REST APIs and SDKs. The Undelete Blob operation restores the contents and metadata of a soft-deleted blob.
For more information, see Undelete Blob REST API.