Added support for forwarding restore commands in an undo/redo scenario.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>