# Restoring Corrupted Datasets

## How to restore a corrupted Deep Lake dataset

**Deliberate of accidental interruption of code may make a Deep Lake dataset or some of its tensors unreadable. At scale, code interruption is more likely to occur, and Deep Lake's version control is the primary tool for recovery.**

### How to Use Version Control to Retrieve Data

When manipulating Deep Lake datasets, it is recommended to commit periodically in order to create snapshots of the dataset that can be accessed later. This can be done automatically when [creating datasets with `deeplake.compute`](/v3.7.2/technical-details/best-practices/creating-datasets-at-scale.md), or manually using [our version control API.](/v3.7.2/getting-started/deep-learning/dataset-version-control.md)

If a dataset becomes corrupted, when loading the dataset, you may see an error like:

```markup
DatasetCorruptError: Exception occured (see Traceback). The dataset maybe corrupted. Try using `reset=True` to reset HEAD changes and load the previous commit. This will delete all uncommitted changes on the branch you are trying to load.
```

To reset the uncommitted corrupted changes, `load` the dataset with the `reset = True` flag:

```python
ds = deeplake.load(<dataset_path>, reset = True)
```

{% hint style="danger" %}
Note: this operation deletes *all* uncommitted changes.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-v3.activeloop.ai/v3.7.2/technical-details/best-practices/restoring-corrupted-datasets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
