A $2 billion trade secrets verdict against Massachusetts-based software company Pegasystems was overturned Tuesday by a Virginia appellate court, which said errors at the jury trial merited returning the case for a new hearing.

The decision by the Court of Appeals of Virginia reverses what had been the largest damages verdict in the state’s history, the court said.