# Quickstart

```python
from pathlib import Path

from unmake import HistoryManager, OperationRegistry, SQLiteStorage

manager = HistoryManager(SQLiteStorage("history.db"))

with manager.start_session(script="cleanup.py") as session:
    Path("a.txt").rename("b.txt")
    session.record_operation("fs.move", {"src": "a.txt", "dst": "b.txt"})


class MoveUndo:
    def __init__(self, payload: dict[str, str]):
        self.src = payload["src"]
        self.dst = payload["dst"]

    def undo(self) -> None:
        Path(self.dst).rename(self.src)


registry = OperationRegistry()
registry.register("fs.move", MoveUndo)
session_id = manager.list_sessions(limit=1)[0].session_id
manager.undo_session(session_id, registry)
```
