Plot Summary
After months in a hospital ward due to heart problems, Homura Akemi transfers into her new school. Although she makes friends with Madoka Kaname, a girl in her class, Homura begins to feel increasingly depressed, unable to compete in sports or answer question in class. On the way home she is preyed upon by a witch, a creature who feeds on despair, but is saved in the nick of time by two magical girls, her classmate Madoka and third year student Mami Tomoe.

Madoka and Mami arrive to save Homura
Homura begins to admire and befriend Madoka, however, following a battle against Walpurgis Night, an extremely powerful witch, both Mami and Madoka had died, sacrificing their lives to save the city.
Unable to accept the loss of her friend, Homura makes a contract with the familiar, Kyubey. In exchange for becoming a magical girl, Homura wishes to meet Madoka

Homura grieves over her friend's death
over again, gaining the ability of time manipulation.
In an attempt to prevent her friend's death, Homura repeats the same time period over and over. Various different situations occur in each time loop, including Sayaka transforming into a witch, and Mami attempting to kill the group after she learns the truth about a magical girl's destiny.

Mami attempts to mercy kill the girls to prevent them from becoming witches
Even after increasing her power and abilities the end result is always the same, Homura is never able to prevent Madoka from dying or transforming into a powerful witch.
Once again unable to prevent Madoka from accepting Kyubey's contract in the final battle, Homura jumps through time and into the present...

Homura once travels to the past to prevent the chain of events