If property, the basis of which was reduced under subsection (b), (c), or (d), is disposed of, any gain realized on the disposition, to the extent it does not exceed the total reduction in the basis of the property under those subsections, shall be treated as an amount referred to in
section 53511(c)(1) of this title withdrawn on the date of disposition of the property. Subject to conditions prescribed in joint regulations, this subsection does not apply to a disposition if there is a redeposit, in an amount determined under joint regulations, that restores the fund as far as practicable to the position it was in before the withdrawal.