Can I take a claim of right repayment credit when filing my 2018 taxes for a repayment made in 2019 on a 2018 bonus?

In 2018, I was paid a bonus of over $10,000 with the contingency that I pay it back if I leave before a year with my employer. I left at the beginning of 2019 and paid back the full bonus in February 2019, including all federal taxes that were originally withheld. Typically I know I would take a claim of right repayment credit when I file my 2019 taxes to recoup the federal taxes I lost. However, since I made the repayment and have the corresponding repayment documents before this year’s tax deadline, would it be at all possible to take the credit on my 2018 tax filing? This would essentially be the same credit amount as if I took it in 2019 since the credit amount would be based on 2018 wage reductions, just recouped earlier. Or do I have to wait until I file my 2019 taxes next year to take the credit?