One who loses by eviction the thing received in barter may recover that which he gave in exchange with a right to damages, or he may only demand an indemnity for damages. However, he can only make use of the right to recover the thing which he has delivered while the same remains in the possession of the other party, and without prejudice to the rights acquired in good faith in the meantime by a third person. (1540a)