Get your taxes done using TurboTax

Any monies paid in 2018 and then repaid in 2018 should have been zeroed out on your W-2.  You should not be issued a W-2 if you were not paid net wages.  There is no tax procedure to deduct wages that were paid and repaid in the same year on your tax return.

For wages paid in 2017 and repaid in 2018, there are two procedures you might use, but one of them requires that you had a reasonable belief at the time that you had an "unrestricted right" to the payment.  It sounds like that might not be the case, which means the second procedure is not allowed to you.  Can you explain more about "it became clear the contract needed to be terminated."