The Last Man in the World. A fellow who is an arrogant ass is wooing a lady who resists his advances and finally tells him "I wouldn't want to be with you even if you were the last man in the world." He bitterly wishes this were true so that she would have to eat her words. Behold, he wakes up the next morning and he is indeed the last man left in the world, as all the others have disappeared. Cue lots of comic scenes about what a world empty of men and run by women would look like.
The protagonist is obviously highly coveted now, being the only man in existence, but even though he has beautiful ladies of all kinds chasing him, he still can't click with his lady love (an ordinary gal, of course) who remains stubbornly true to her declaration.
Somehow, with great effort and self-sacrifice and learning of valuable lessons, he manages to reverse his wish. And, of course, gets the girl.
How has this never been done before? Maybe it has. Copyright me, just in case...