While trying to get the things that Dumbledore left them to Harry and Ron, Hermione trips down the stairs and sprains her ankle as Snape exits office.
He prevents her fall by catching her and bringing her to nurse's station and leaves (to find crutches).
Meanwhile Harry and Ron come and pick things up from Hermione sneakily and try to leave through the exit that is blocked due to Voldemort's Binding Spell.
When Snape returns, Hermione stalls him from possibly leaving in Harry and Ron's direction by asking him what really happened on the night when he killed Dumbledore.
Meanwhile Ginny and Neville successfully steal the 'Sword of Gryffindore' from Snape's office and don't tell anyone about it.
Later she sees him leaning over the pool of memories and discovers a lot of his memories about Lilly and sending the doe patronus, etc.,
Then she sneaks to check and sees the sowrd is not there, and Snape catches her red-handed. He realizes that Dumbledore didn't trust him enough (about the location of the real sword).
Hermione realizes a potential revelation about Harry's and Snape's death and uses MaGonagall's time traveller to return to Snape's past to try to change things. He makes her promise not to make any references about what already happened (so that Lilly's death does not happen for only selfish reasons).
In his past, Hermione befriends Snape and prevents him from joining Voldemort. Voldemort tries to kills Snape for this, but Hermione sacrifices herself (since she knows that Voldemort's Elder Wand can only perform the sacrificial death spell once – already did so by killing Lilly - regardless of the time travel). Hermione receives the scar on her forehead instead of Harry as a result.
Upon her return to future, Harry's parents are alive, Hermione and Ron break up and Lilly does not try to hide her fondness of Snape, therby making Harry's dad angry at Snape.
James discovers that Voldemort needs Hermione, so he makes the Unbreakable Vow (to pass on Voldemort's legacy if Volde fails) with Voldemort to victimize her so that Voldemort kills Snape in return. In this way, Lilly would not be tempted by Snape.
Voldemort tries to kill Hermione, but Snape kills Voldemort first (so Lilly becomes free of Volde's spell, now that he is dead, but James didn't know that when he made the vow that it was Volde causing Lilly to be drawn to Snape) James Potter becomes the new Volde (thereby involuntarily fulfilling the Vow).
Harry Potter returns. He does not who to trust or kills: Volde or Snape? Lilly cries "He's your father!" at 'Volde', but the Volde withing James persuades Harry to kilss Snape while James' voice says "Eliminate the monster within me, Harry!"
Harry kills Voldemort.
Hermione and Ron get back together.
***Snape and Hermione realize that they were meant to go their separate ways, though their temporary unification was needed to prevent the deaths of Harry's parents and Snape, as well as save all of Hogwarts.***
