The defendant in an attachment suit may replevy the real or personal property attached by giving bond, with good security, payable to the plaintiff, in double the amount of the plaintiff's demand, or, at defendant's option, in double the value of the property attached, conditioned to pay the debt, interest, and costs, or the value of the property attached, with interest, as the case may be, in the event the defendant shall be cast in the suit.