(+351) 21 24 10006  ·  info@bconcepts.pt
Carnaxide, Lisbon

Time Travel in the Microsoft Fabric Lakehouse: step by step

João Barros 25 de July de 2026 4 min read

Time Travel in the Microsoft Fabric Lakehouse allows you to view and recover previous versions of Delta data. This feature is useful for auditing, recovering data after accidental changes, or comparing historical states of a table.

Prerequisites

  • Microsoft Fabric account with Writer permissions on the Lakehouse.
  • A Lakehouse with at least one Delta table (e.g., nome_da_tabela).
  • Access to a Warehouse SQL query endpoint or a Notebook with SQL support.
  • Permission to perform administrative operations on the table (RESTORE/SELECT).

Step 1: Check the table history

The first step is to view the table's commit history to identify the version or timestamp you want to recover. Use DESCRIBE HISTORY to obtain the versions, including author, timestamp and message.

DESCRIBE HISTORY nome_da_tabela;

Analyze the version and timestamp columns to choose the target version. Note the version number (e.g.: 5) or the timestamp.

Step 2: Query a specific version (Time Travel read)

Before making any changes, you can inspect the old version without altering it. Use VERSION AS OF in a SELECT to read the data at that version.

SELECT *
FROM nome_da_tabela VERSION AS OF 5
LIMIT 100;

This creates a consistent read of version 5. Useful to validate that the data you want to recover is correct.

Step 3: Export or create a copy of the old version

It is recommended to create a copy before restoring. You can create a new table with the content of the old version or export to a file in OneLake.

-- Create a temporary table with the old version
CREATE TABLE nome_da_tabela_backup_v5 AS
SELECT * FROM nome_da_tabela VERSION AS OF 5;

-- Or export to CSV in OneLake (adjust the path according to your OneLake)
COPY INTO 'OneLake:////nome_da_tabela_v5.csv'
FROM (SELECT * FROM nome_da_tabela VERSION AS OF 5)
WITH (FILE_TYPE='CSV', HEADER=TRUE);

Having a copy prevents data loss if something goes wrong during the restore process.

Step 4: Restore the table to the previous version

Once you have confirmed the correct version and have a copy, you can restore the table to the desired version. The command below sets the table to the state of version 5.

RESTORE TABLE nome_da_tabela TO VERSION AS OF 5;

After running, the table will reflect the content of the specified version. Depending on permissions and organizational policy, this command may require administrative privileges.

Step 5: Validate the restore and best practices

After the restore, confirm the table is in the expected state and record the changes for auditing. Avoid running processes that remove history (e.g., VACUUM) without agreement, because they delete metadata needed for Time Travel.

-- Check the current version
SELECT MAX(version) AS versao_actual
FROM (DESCRIBE HISTORY nome_da_tabela);

-- Read the restored data
SELECT TOP 100 * FROM nome_da_tabela;

Log who performed the restore, the target version and the reason. Keep backups (copies in OneLake) for alternative recovery.

Verify the result

Confirm success with these steps: 1) DESCRIBE HISTORY nome_da_tabela should show a new restore commit or a pointer to the restored version; 2) run a simple SELECT to validate data; 3) compare row by row with the backup table created in Step 3.

-- Simple comparison
SELECT COUNT(*) AS total_original
FROM nome_da_tabela_backup_v5;

SELECT COUNT(*) AS total_restaurado
FROM nome_da_tabela;

Conclusion

Time Travel in the Microsoft Fabric Lakehouse makes it easy to recover previous states of Delta tables for auditing and error recovery. Next steps: automate checkpoints before critical changes, integrate checks into CI/CD and define history retention policies. Tip: before using VACUUM or cleanup policies, make sure you won't lose the ability to restore important versions — which is the most critical version you need to be able to recover in your organization?