Add undo operation

Pop the deque of Lines if it isn't empty then invalidate the view