Frage im Vorstellungsgespräch bei Algotec

there is a paint program, how do you implement a undo method?