Yes, if the repayment was $3000 or more. But the credit is a non-refundable credit. It can only be used to reduce you tax liability. None of it will be sent to you as a refund.
This situation is described in IRS
Publication 525. pgs 34-35. You can take
a misc itemized deduction, on line 16 of schedule A (not subject to the 2% of AGI
threshold) Or you can take a credit. The credit is computed by refiguring the
tax return from the previous year as if the income had not been received. Then
the difference in tax is claimed as a credit on the current year's return. In the forms mode (the forms mode is not
available in the on-line versions of TurboTax[TT]), you can use the line 74 smart work sheet to enter the credit amount on line 74; select item D, claim of
right under IRC 1341 for repayments. TT will enter "I.R.C.1341" on the line next
to box d on line 74 of form 1040 (schedule 5). TT does not do the calculation or compare it
to the alternate deduction.
So, the taxpayer has the option of
either claiming the credit or deducting the repayment as a miscellaneous
itemized deduction, whichever provides the greater benefit. But, you cannot
file an amended prior year return.
If the amount is $3,000 or less, only the
miscellaneous itemized deduction, subject to the 2% of AGI threshold,
was allowed in the past . All miscellaneous itemized deduction, subject to the 2% of AGI rule go away
in 2018. I've seen nothing yet to indicate if there will be an exception for
repayments of income
https://www.irs.gov/pub/irs-pdf/p525.pdf