If I have to return a retention bonus in 2022 that was paid in 2021 w/ tax witheld, how would I handle the tax filing now?

I was paid a retention bonus in Aug 2021 with the condition that I will have to repay if I leave within 12 months. Tax was witheld on that bonus payment. I later decided to leave the company in Apr 2022 and am now required to repay the retention bonus. My current W2 includes this bonus as compensation. How do I handle this situation from a tax filing perspective?