If the defendant, at any time before judgment, causes a bond to be executed to the plaintiff with sufficient sureties, to be approved by the officer having the attachment or after the return thereof by the clerk, conditional on the performance of the judgment of the court, the attachment shall be discharged and restitution made of property taken or proceeds thereof. The execution of such bond shall be deemed an appearance of such defendant to the action. The bond shall be part of the record and, if judgment goes against the defendant, the judgment shall be entered against the defendant and the sureties.