TJX Cos. and nearly all the banks and bank associations that sued the discount retailer over a massive credit card data breach said Tuesday they have settled the lawsuit for an undisclosed amount.

Although both sides said the settlement total would remain confidential, TJX said the costs were covered by a $107 million reserve that it set aside against its second-quarter earnings.