There are infinite universes(timelines), and some of them are exactly like each other except one thing that happened in one and didn't happen in the other, for example in one universe there was a flood but in the other, there wasn't. Or in one universe link won but in the other he lost
Well, if it had over written the latter part of ocarina then he wouldn't have had the knowledge to go back in the first place sorta Like going back in time to kill your grand father
Time travels, right?