Memento

Capture state now, restore it later

Memento snapshots an object's internal state into a separate token so you can restore it later โ€” without exposing how the object stores things. A booking draft can be saved before risky edits; if the user cancels, you put the saved state back.

The memento is just captured data (often a dict copy). save_state() produces it; restore(memento) writes it back.