There are two scenarios depending on what you need to undo:
To un-deposit a specific payment from a deposit record:
Go to Accounting > Deposits, find the deposit, and select View Details. On the Existing Client Payments tab, deselect the row on the left to un-deposit that payment. You can also delete the deposit entirely from the same screen using the row-action menu > Delete.
To reverse the actual ePayment transaction (refund/return):
You cannot delete or edit an ePayments transaction directly in CORE. Refunds must be initiated through the merchant portal (AffiniPay or Stripe). When initiated, CORE handles the rest automatically, and it marks the invoice as unpaid, creates a negative payment record, adds a negative line item in the next ePayments deposit, and creates the balancing General Journal entries. Note that CORE only supports full refunds, and partial refunds are not supported.