“Elijah comes, and will restore all things.” Jesus knew that John the Baptist was “Elijah.” Here Jesus used the words of the doctrinal formula commonly used about Elijah by the religious leaders to show they were quite correct—Elijah was coming, but now he had already come. The Scribes had not been wrong when they said “Elijah is coming,” they just did not know to whom they referred and thus missed it when he was among them. Jesus, however, knew that “Elijah” was John the Baptist, as is clear from Matt. 17:12-13.
In this verse Jesus was referencing the promise in Malachi that Elijah would come. The verb “will restore” (ἀποκαταστήσει) appears here in the same form as in the Septuagint text, an echo of the fact that Jesus, speaking Hebrew or Aramaic, would have been using the same vocabulary as Malachi. The Apostles were not confused by Jesus saying John “will restore” things because they knew the Old Testament text and Jesus immediately followed up what he said by adding that “Elijah” was John. Since John was already dead (see Matt. 14:1ff), it was clear that he was not going to restore anything. That was now left to Jesus. We learn from Mark that John the Baptist came to restore things, and tried unsuccessfully to do so, thus being one of the reasons that the Messiah would have to suffer (see commentary on Mark 9:12).