Whenever a change to the future is made, a branch timeline is made and it doesn't actually "change" their original timeline.
The Marty we know, let's call him Marty 1, created a new timeline, timeline 2. Evidence of this is when Twin Pines Mall changes to Lone Pines Mall. Timeline 2 [really timeline 3 because of the Pines Mall mentioned earlier, but for the purposes of this comment, and to make it SO MUCH simpler to understand, let's call it timeline 2] was created when he met his parents [got ran over instead of George] and met Doc.
The Marty that Marty 1 sees when he returns to 1985 is Marty 2, a Marty who grew up in this timeline [timeline 2] where similar events occur only this timeline's Doc, Doc 2, is aware of the Libyans and came prepared since he met Marty 1 and read his letter. Marty 1 retains the memory of HIS timeline, timeline 1.
Marty 2 would go back and create a new timeline as well, timeline 3, and witness Marty 3 doing the same and etc. Not a loop, but a continuous cycle.

(Made a mistake in the picture. Where it says "M3 changes the future" I meant to put M2 [Marty 2] since that would make sense. Anyway, moving on.)
Unrelated but people wonder how Old Biff from 2015 was able to return to his timeline if this is the case. The common misconception with BTTF is that time changes INSTANTANEOUSLY, when instead it changes GRADUALLY, at a different rate.
Think of the changes as a ripple effect, like how you throw a rock into a pond and ripples in the water take a while to reach the edge. Old Biff, as soon as he gave the Almanac to his younger self, returned to his time before the ripples of time reached 2015. In Marty and Doc's case, the ripples have already washed over their time and the events are set, unless they change it again.
Of course the changes to the timeline happen at different rates (making it convenient and easy for the screenwriters, lol), but what remains constant with the different rates of change is that it's not instantaneous, but gradual.
The time travelers remain unaffected by time travel since they experienced it themselves. Unless it affects their existence of course. When Old Biff returned to his 2015, he looked labored. There's a deleted scene where he slowly fades away since his time traveling effected his existence.
I hope I was able to clear things up in regards to BTTF.