If the Secretary of Agriculture shall find after the acquisition by the United States of any land or interest therein which is subject to his administration, custody, or control, other than land acquired by exchange of public domain land or resources, that the title thereto is legally insufficient for the purposes for which such land or interest was acquired and no consideration therefor has been paid by the United States, or that title or color of title to such land or interest was acquired through mistake, misunderstanding, error, or inadvertence, he is authorized to execute and deliver on behalf of and in the name of the United States to the person from whom the title was acquired or to the person whom he finds entitled thereto a quitclaim deed to such land or interest: Provided, however, That if the person to whom such deed is made is the same person from whom the United States acquired title, or his successor in interest, any consideration given by the United States for such land or interest shall be restored or, in lieu thereof, the value equivalent of such consideration as determined by the Secretary of Agriculture shall be paid to the United States; and any consideration or value equivalent so restored or paid shall, so far as is practicable, be restored to the jurisdiction, or deposited to the credit, of the department, agency, appropriation, or fund from which the consideration was transferred or paid at the time of the acquisition of title by the United States.