first working version of undo done

Signed-off-by: Chris Jones <chris@jonezy.org>