Not sure if this will work for mileage upgrades, but for cash-only upgrades, you can request a refund via the link below that will be issued as a trip credit. When the upgrade was processed you may have received a ticket number. If so, that's the ticket number you should enter in the form below. Good luck!
https://prefunds.aa.com/refunds/