If, after the defendant moves from property in compliance with an order or agreement for possession or in reasonable contemplation of its taking by the plaintiff, the proceeding is dismissed with regard to that property for any reason or there is a final judgment that the plaintiff cannot acquire that property, the court shall:
(a)
Order the plaintiff to deliver possession of the property to the persons entitled to it; and(b)
Make such provision as shall be just for the payment of all damages proximately caused by the proceeding and its dismissal as to that property.
Source:
Section 1268.620, https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=CCP§ionNum=1268.620.
.