This article discusses a California case which held that when a former property owner reacquires it after foreclosure with a new purchase money loan, that lien has priority over the previously wiped-out junior lien that reattached to the property.
Bernhardt, Roger, "Liens reattaching after foreclosure: DMC v Downey Sav. & Loan, 2002" (2002). Publications. 319.