At the beginning of part I, Biff was his father's supervisor, who was constantly harassed by Biff. At the end of the film, when Marty returns to 1985 from 1955, he altered the timeline to one where his father had stood up to Biff and became a successful author, and Biff was a contractor for auto detailing. Marty is surprised to see how things have changed as he still remembered the original timeline.
Before Marty goes home, we see him at the mall's parking lot, watching his past self travel back to 1955. Lets call the Marty that just returned to 1985 Marty A and the Marty he is watching Marty B. Presumably, Marty B has memories of the altered timeline: then one where his father was a successful author. Marty B then travels back to 1955 who would then be able to go back to the future when lightning hits the clocktower. He would then become Marty A who only has memories of the original timeline, but Marty B has memories of the altered timeline. So how do the memories of the two Martys converge?
One theory is that once Marty B travels back to 1955, his memory reverts to that of Marty A. This would mean if someone went back in time, met Doc and Marty in the parking lot, then traveled with Marty back to 1955, Marty would not remember meeting this person in the parking lot. Once he saw the other person in the DeLorean, he would wonder who they are and how they got there. Suppose this person would explain to Marty who they are, stay in 1955 for a week like Marty and then return to 1985 with Marty. While Marty was in 1955, he would most likely remember interactions with this person since they arrived in 1955 (but not while they were still at the parking lot in 1985). However, once the two of them arrived back in 1985, Marty's memory would again revert to Marty A, and the other person would have to explain again who they are and how they got there.
In part III, Doc from 1955 gives Marty a strange outfit and sends him back to 1885. Once Marty arrived in 1885 and met Doc (the Doc who was originally from 1985), he had no memory of giving Marty the strange clothes and sending him back to 1885. What if further time travel resulted in Doc being killed at another point in time and Marty had to warn him again? If Doc had been killed at a point where he had not yet experienced time travel, Marty could warn him any time before that point and Doc would remember. However, once Doc traveled through time, he would forget anything that happened in alternate timelines, so the only way Marty could warn Doc in that scenario would be to warn him after his last time travel experience.