Short answer. Your right to reimbursement for those improvements is governed by the possession rules in Book II of the Civil Code. Whether you can recover, and how much, depends on whether you were in good faith when you made the improvements — and the possession rules are generally protective of good-faith possessors.
What the law says
the provisions of Title V of Book II shall govern
Civil Code, Article 2161 — Improvements and Expenses. Read the full provision →
What Article 2161 says
When a person receives property through a mistaken payment — solutio indebiti, or payment of what was not owed — the Civil Code requires them to return it. But if they made improvements while they held it, Article 2161 does not leave that question unresolved. It directs that the provisions of Title V of Book II shall govern the reimbursement for improvements and expenses. Title V of Book II contains the Civil Code's detailed rules on possession, including the rights of possessors who built, planted, or improved in good faith. The result is that your situation is not governed by a special rule for mistaken payees — it is governed by the same framework that applies to any possessor who made improvements on property they eventually had to surrender.
Good faith makes a meaningful difference
Under the possession rules that Article 2161 points to, good faith possession carries significant protection. A good-faith possessor who makes necessary or useful improvements generally has the right to be reimbursed for them, or at least to retain the property until reimbursed. The key fact is your state of mind when you made the improvements: did you honestly and reasonably believe the property was yours? If the payment was a genuine mistake and you had no reason to suspect otherwise, good faith is likely present. A possessor in bad faith — one who knew or should have known the property was not rightfully theirs — is in a significantly weaker position.
Types of expenses and improvements
The possession rules distinguish between different categories of outlays. Necessary expenses — those needed to preserve the property — are generally recoverable by any possessor, even one in bad faith. Useful improvements — those that add value to the property but are not strictly necessary — are typically recoverable by a good-faith possessor. Ornamental or luxury expenses are treated more restrictively: a good-faith possessor may remove them if removal is possible without damaging the property, but cannot compel the owner to pay for them. Knowing which category your improvements fall into is essential to understanding what you can actually recover.
What to document and keep
If you are facing a demand to return property on which you made improvements, gather everything that shows what you spent and when. Receipts, contractor invoices, photographs taken before and after, and any communication that reflects your honest belief of ownership all become relevant. The possession rules give protection to good-faith improvers, but you will need to establish both the good faith and the value of the improvements. Consulting a lawyer before surrendering the property — without first discussing reimbursement — is advisable, since the possessor's right to reimbursement can sometimes be enforced as a lien on the property itself.