How to delete file infected in Time Machine

Unfortunately, I switched from Time Machine on HFS+ to APFS nearly a year ago.