reset password undo logic