If a person committed to jail is under indictment or complaint for, or is under recognizance to answer to, a charge of assault and battery or other misdemeanor for which he is liable in a civil action, unless the offence was committed by or upon a sheriff or other officer of justice, or riotously, or with intent to commit a felony, or is a violation of an order issued pursuant to section 18 or 34B of chapter 208, section 32 of chapter 209, section 3, 4 or 5 of chapter 209A or section 15 or 20 of chapter 209C, a violation of sections 13M or 15D of chapter 265 or would otherwise constitute abuse, as defined in section 1 of said chapter 209A, and the person injured appears before the court or justice who made the commitment or took the recognizance, or before which the indictment or complaint is pending, and acknowledges in writing that he has received satisfaction for the injury, the court or justice may in its or his discretion, upon payment of such expenses as it or he shall order, discharge the recognizance or supersede the commitment, or discharge the defendant from the indictment or complaint, and may also discharge all recognizances and supersede the commitment of all witnesses in the case.
Mass. Gen. Laws ch. 276, § 55