The perfecting of an appeal shall not stay enforcement of the judgment or order in the trial court if the judgment or order appealed from directs the sale, conveyance or delivery of possession of real property which is in the possession or control of the appellant or the party ordered to sell, convey or deliver possession of the property, unless an undertaking in a sum fixed by the trial court is given that the appellant or party ordered to sell, convey or deliver possession of the property will not commit or suffer to be committed any waste thereon and that if the judgment or order appealed from is affirmed, or the appeal is withdrawn or dismissed, the appellant shall pay the damage suffered by the waste and the value of the use and occupancy of the property, or the part of it as to which the judgment or order is affirmed, from the time of the taking of the appeal until the delivery of the possession of the property. If the judgment or order directs the sale of mortgaged real property and the payment of any deficiency, the undertaking shall also provide for the payment of any deficiency.
Ca. Civ. Proc. Code § 917.4