You can reverse the transaction and get your money back. If you made a transfer to the wrong account with invalid details, the funds would automatically be returned to your account. In case it fails, you'll need to take the relevant measures to recover the money.