Restore ans to previous value when undo.