The basic theory of a vaccine is that if you build up your immune system to fight a virus before you get the virus, that you can prevent yourself from being infected. A new vaccine for the most deadly strain of HPV, which causes cervical cancer and genital lesions, reduced or eliminated HPV symptoms in 14 of 20 already HPV infected and symptomatic women who received it in a Dutch study. The other six women did not benefit, but this may be because all had severe and well established cases (often ten years of infection) already.
The new vaccine trains immune system T cells to fight off the virus, just as vaccines administered before infection do. Anti-viral drugs, in contrast, target the viruses themselves.
Two existing vaccines for HPV have not be investigated for post-infection use, impact more strains of HPV, and are approved for administration to uninfected girls and young women.