Prior period tax adjustments

I work with an inventory program that syncs/writes to QuickBooks. Recently due to a glich many customer invoices dating back to 2015-2017 were deleted/recreated during a synchronization. It is impossible to 'undo'. Unfortunately, the sales tax rates for some of these invoices have changed since then. When the invoices were recreated with the old dates, QB used the current sales tax rate for those customers, thus creating a tax overcharge. Any suggestions on the best way to fix this would be greatly appreciated.