# 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."


---

# 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.aios.foundation/aios-docs/aios-kernel/storage/sto_rollback.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.
