Documentation Language: Swift

Method

undo()

Undo the command, reversing its changes to the model.

@MainActor func undo() async throws

Discussion

This method should restore the model to the exact state it was in before the command was executed. It should only be called on commands where canUndo returns true.