Leviticus 25:25-25:28
If your kinsman is in straits and has to sell part of his holding, his nearest redeemer shall come and redeem what his kinsman has sold. If a man has no one to redeem for him, but prospers and acquires enough to redeem with, he shall compute the years since its sale, refund the difference to the man to whom he sold it, and return to his holding. If he lacks sufficient means to recover it, what he sold shall remain with the purchaser until the jubilee; in the jubilee year it shall be released, and he shall return to his holding.