If a sale of property be made under a decree or order of a court, and such sale be confirmed, though such decree or order be afterwards reversed or set aside, the title of the purchaser at such sale shall not be affected thereby; but there may be restitution of the proceeds of sale to those entitled.