When personal property is sold and the vendor retains the title until all the purchase money is paid, if the vendor or his assigns shall bring an action to recover the possession of such personal property, the defendant in the action may plead as a setoff any demand or claim that he may have against the plaintiff or may recoup any damages that he has sustained by reason of any failure of consideration, any defects in the personal property, or any breach of contract by the plaintiff whereby the defendant has in any way been injured or damaged. If the plaintiff elects to take a money judgment for the value of the property, the amount of the setoff or damages allowed the defendant by the jury shall be deducted from the value of the property and the amount allowed for the hire or use thereof and the plaintiff shall only recover the excess; but, if the amount of the setoff or damages allowed the defendant shall exceed the value of the property and the hire thereof, the defendant shall have judgment against the plaintiff for such excess. If the plaintiff elects to take a judgment for the property, the amount allowed the defendant as the setoff or damages shall be a lien on such property superior to all other liens except liens for taxes.
OCGA § 44-12-154