1491. A person who receives a payment made in error, or merely to avoid injury to the person making it while protesting that he owes nothing, is obliged to restore it.
He is not obliged to restore it, however, where, in consequence of the payment, the claim of the person who received the undue payment in good faith is prescribed or the person has destroyed his title or relinquished a security, saving the remedy of the person having made the payment against the true debtor.