Inform the beneficiary bank.
The sender can visit the receiver's bank branch, inform them, and give a written request to return the amount, showing proof that the money was transferred mistakenly to the beneficiary (screenshot of the transaction, bank account details, etc.).
According to RBI, “Responsibility to provide correct inputs in the payment instructions, particularly the beneficiary account number information, rests with the remitter/originator. While the beneficiary’s name shall be compulsorily mentioned in the instruction request, and carried as part of the funds transfer message, reliance will be only on the account number for the purpose of affording credit. This is applicable both for transaction requests emanating at branches and those originated through the online/ internet delivery channel. The name field in the message formats will, however, be a parameter to be used by the destination bank based on risk perception and/or use for post-credit checking or otherwise.”
If you have transferred the amount to the wrong account and the account details are invalid, your money will automatically return to your account
So, if you accidentally transfer money to the wrong bank account, you can request a reimbursement from your bank by informing them of the RBI guideline from October 2010. However, it depends on the recipient to provide permission for reversal of transaction.