Steins Gate question regarding the ending.......?Major spoilers

Hi guys.
I just want to clarify one major thing that bugs me to no end.
In episode 24 we find out that Okabe coordinates a simulation of Kurisu’s death..
From this we can tell that she didn’t actually die.
In other words,the d-mail sent to save Kurisu was useless,because she survived anyway..
When Okabe undid Kurisu’s d-mail,the timeline changed,and she was dead.
How does that make sense?
Timeline:

Kurisu wasn’t dead.Okabe spilled his own blood to make himself believe that Kurisu died,so that he will send the d-mail to save her and start the original story all over again(the loop).
When he undid the d-mail,she was dead...
Please,someone help...