The defendant may, within the time set by the court, require the return of the property upon delivering to the peace officer having custody of the property a written undertaking approved by the clerk of the court and executed by sufficient sureties to the effect that they are bound in double the value of the property for the delivery of the property to the plaintiff, if such delivery be adjudged, and for the payment to the plaintiff of such sum as may, for any cause, be recovered against the defendant.