(d)in a case where a deduction has been allowed for a bad debt (or part of it) under the provisions of section 31(2), and any amount subsequently recovered exceeds the difference between such debt and the amount allowed, then the amount in excess, in the tax year in which recovery is made;