On any rehearing or new trial had under § 8.01-575, the court may order the plaintiff in the original attachment to restore any money paid to him under such judgment to such defendant if living, or if dead to the heir or personal representative of such defendant, as the same may be, the proceeds of real or personal estate, and enter a judgment therefor against him; or it may confirm the former judgment. In either case it shall adjudge the costs of the prevailing party.
Va. Code § 8.01-576