From irs.gov
Q7. May I repay a coronavirus-related distribution?
A7. In general, yes, you may repay all or part of the amount of a coronavirus-related distribution to an eligible retirement plan, provided that you complete the repayment within three years after the date that the distribution was received. If you repay a coronavirus-related distribution, the distribution will be treated as though it were repaid in a direct trustee-to-trustee transfer so that you do not owe federal income tax on the distribution.
If, for example, you receive a coronavirus-related distribution in 2020, you choose to include the distribution amount in income over a 3-year period (2020, 2021, and 2022), and you choose to repay the full amount to an eligible retirement plan in 2022, you may file amended federal income tax returns for 2020 and 2021 to claim a refund of the tax attributable to the amount of the distribution that you included in income for those years, and you will not be required to include any amount in income in 2022. See sections 4.D, 4.E, and 4.F of Notice 2005-92 for additional examples.