Break Up to Make Up

The protagonist pines for the unrequited love of their significant other, only to later have a breakthrough and realize their own self-worth. Sometimes he/she manages to Take A Level In Badass.

Anime and Manga

 * Possible example in D.N.Angel, in which Daisuke does not get his original love interest and gets taught a lesson that your first love isn't necessarily your only love.

Comic Books

 * Scott Pilgrim. Yes, even knowing the series contains this trope is a spoiler.

Film

 * Teen Wolf, whereby a surprise reversal of Did Not Get The Boy takes place.
 * Yes Man
 * The Mirror Has Two Faces: It’s only after Rose tells Greg that she doesn’t want a passionless marriage and breaks up with him that Greg realizes that he was in love with her all along.
 * The French film Naissance des pieuvres (Water Lilies). Dumpy, uncool Anne spends most of the movie longing for star swimmer François, who barely deigns to notice her. However, after he  she decides he's not worth it and emphatically tells him so by   Anne's best friend Marie pines for star synchronized swimmer Floriane, but after a good many things have happened gives up on her as well and returns to her friendship with Anne.
 * Forgetting Sarah Marshall: Peter does eventually go in this direction.

Literature

 * High Fidelity

Live-Action TV

 * Played with in Spaced; Tim spends most of the first season pathetically moping about his transparently unfaithful and unworthy girlfriend Sarah. When she wants to get back with him at the end of the season, he's initially elated, but comes to his senses and breaks it off with her for good, and is much happier in the second season as a result.