Here's a proof that follows the MIT solution set linked in the original question more closely. For clarity, I will use the same notation they use so the comparison can be more easily made.
Suppose we have two vertices $a$ and $b$ such that the distance between $a$ and $b$ on the path $p(a, b)$ is a diameter, e.g. the distance $d(a, b)$ is maximum possible distance between any two points in the tree. Suppose we also have a node $s \neq a, b$ (if $s = a$, then it would be obvious that the scheme works, since the first BFS would get $b$, and the second would return to a). Suppose also that we have a node $u$ such that $d(s, u) = \max_x d(s, x)$.
Lemma 0: Both $a$ and $b$ are leaf nodes.
Proof: If they weren't leaf nodes, we could increase $d(a,b)$ by extending the endpoints to leaf nodes, contradicting $d(a, b)$ being a diameter.
Lemma 1: $\max [d(s,a), d(s, b)] = d(s, u)$.
Proof: Suppose for the sake of contradiction that both $d(s, a)$ and $d(s,b)$ were strictly less than $d(s, u)$. We look at two cases:
Case 1: path $p(a, b)$ does not contain vertex $s$. In this case, $d(a, b)$ cannot be the diameter. To see why, let $t$ be the unique vertex on $p(a, b)$ with the smallest distance to $s$. Then, we see that $d(a, u) = d(a, t) + d(t, s) + d(s, u) > d(a, b) = d(a, t) + d(t, b)$, since $d(s, u) > d(s, b) = d(s, t) + d(t, b) > d(t, b)$. Similarly, we would also have $d(b, u) > d(a, b)$. This contradicts $d(a, b)$ being a diameter.
Case 2: path $p(a, b)$ contains vertex $s$. In this case, $d(a, b)$ again cannot be the diameter, since for some vertex $u$ such that $d(s, u) = \max_x d(s, x)$, both $d(a, u)$ and $d(b, u)$ would be greater than $d(a, b)$.
Lemma 1 gives the reason why we start the second Breadth-First search at the last-discovered vertex $u$ of the first BFS. If $u$ is the unique vertex with the greatest possible distance from $s$, then by Lemma 1, it must be one of the endpoints of some path with a distance equal to the diameter, and hence a second BFS with $u$ as the root unambiguously finds the diameter. On the other hand, if there is at least one other vertex $v$ such that $d(s, v) = d(s, u)$, then we know that the diameter is $d(a, b) = 2d(s, u)$, and it doesn't matter whether we start the second BFS at $u$ or $v$.