Short answer. In three ways: when the seller hands the goods to a carrier or other bailee for transmission to the buyer without reserving ownership or the right to possession; when the buyer or his agent lawfully obtains possession; or by waiver. Obtaining a court judgment for the price does not, by itself, destroy the lien.
What the law says
The unpaid seller of goods loses his lien thereon: (1) When he delivers the goods to a carrier or other bailee for the purpose of transmission to the buyer without reserving the ownership in the goods or the right to the possession thereof; (2) When the buyer or his agent lawfully obtains possession of the goods; (3) By waiver thereof.
Civil Code, Article 1529 — Loss of the Lien. Read the full provision →
The lien is about possession
An unpaid seller's lien is the right to hold on to the goods until the price is paid. Because it is a possessory right, it lives and dies with possession. That single idea explains all three grounds of loss. Shipping the goods out without protecting your position, or letting the buyer lawfully take them, ends the physical control that gave the lien its force. Sellers who understand this stop thinking of the lien as a status they hold and start thinking of it as something they must actively preserve at the moment of shipment.
Shipping without a reservation
The first ground is the one that costs sellers the most money. Handing goods to a carrier or other bailee for the purpose of transmission to the buyer ends the lien — unless the seller reserves the ownership in the goods or the right to the possession of them. The reservation is not a formality to be added later; it has to be built into how the shipment is documented, typically through the terms of the bill of lading or the consignment. A seller who ships on open terms to an unfamiliar buyer, keeps no reservation, and then hears the buyer is in trouble has usually already lost the strongest remedy he had.
Lawful possession by the buyer, and waiver
The second ground turns on the word lawfully. Possession the buyer obtains by right — under the contract, or through his authorised agent — kills the lien. Possession seized without right does not have the same effect, though recovering goods taken that way is its own fight. The third ground, waiver, can be express or can be inferred from conduct inconsistent with asserting the lien: granting fresh credit terms, agreeing to release the goods against a promise, or acting for a long period as though the price were unsecured. Anything a seller signs after a payment problem emerges should be read with this in mind.
A judgment does not extinguish it
The article ends with a protection that is easy to miss: a seller having a lien does not lose it by reason only that he has obtained judgment or decree for the price of the goods. Suing and winning is not treated as an election to abandon the security. That matters against a buyer who is insolvent, where a money judgment may be worth very little and the goods themselves are the real value. Note the limits of this article, though — it says nothing about when the lien arose, what part of the goods it covers, or how the seller may resell. Those sit in the neighbouring provisions, and the practical steps should be taken with counsel before the shipment moves.