If you accidentally applied a payment to the wrong invoice, you can correct the error by editing the payment transaction.
To do this task
Go to the Lists menu and click Chart of Accounts.
Select your accounts receivable account.
Select the payment transaction that you want to change.
Click Edit Transaction.
In the Receive Payments window, correct the error.
Save the correction.