If the defendant recovers judgment against the plaintiff, or if the claim for relief upon which the attachment is based is dismissed, then any undertaking received in the action, all the proceeds of sales and money collected by the sheriff, and all the property attached remaining in the sheriff's hands, shall be delivered to the defendant or the defendant's agent, and the order of attachment shall be discharged and the property released therefrom; but if an appeal is taken from an order dissolving or discharging the attachment, from a final judgment in favor of the defendant or from an order dismissing the claim for relief upon which the attachment is based, the court may, upon such terms as are just, stay or enjoin the release by the sheriff and the dissolution of the writ pending the appeal.
NRS 31.170