> For the complete documentation index, see [llms.txt](https://docs.aios.foundation/aios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aios.foundation/aios-docs/aios-kernel/storage/sto_rollback.md).

# sto\_rollback

```python
def sto_rollback(file_path: str, n: int = 1, time: str = None) -> str
```

[Source code](https://github.com/agiresearch/AIOS/blob/main/aios/storage/filesystem/lsfs.py)

Descriptions: Rollback files to a specific version

Parameters:

* file\_path (str): Path to the file
* n (int): Number of versions to roll back (default: 1)
* time (str): ISO format timestamp to roll back to (optional)

Returns:

* Success message (str): "Successfully rolled back the file: {file\_path} to its previous {n} version"
* Failure message (str): "Failed to roll back the file: {file\_path} to its previous {n} version"
* Redis error (str): "Redis is not enabled. Please make sure the redis server has been installed and running."
