He gives the order of events when he says, However, after his brethren, that is, his relatives, had gone up, he himself went up for the feast. This seems to conflict with what he had said before: "I will not go up", for the Apostle says, "Jesus Christ, whom we preached among you... was not 'Yes' and 'No,' but only 'Yes.'" (2 Cor 1:19).
I answer, first, that the festival of Tabernacles lasted for seven days, as was mentioned. Now our Lord first stated, "I, however, will not go up for this festival," that is, for its beginning. When it says here that he himself went up for the feast, we should ...understand this to refer to the middle of the feast. This is why we read a little further on: "Now, when the festival was half over" (v 14). So it is clear that Christ was not breaking his word. Secondly, as Augustine says, his relatives wanted him to go to Jerusalem to try for a temporal glory. So he said to them: "I, however, will not go up for this festival," for the purpose you want me to. But he did go to the festival to teach the people and to tell them about an eternal glory. Thirdly, as Chrysostom says, our Lord said, "I, however, will not go up for this festival," to suffer and die, as they wished; but he did go, not in order to suffer, but to teach others.
The way he went was not publicly, but as it were in secret. There are three reasons for this. The first, given by Chrysostom, is so that he would not call more attention to his divinity, and so perhaps make his incarnation less certain, as was said above; and so that those who are virtuous would not be ashamed to hide from those who are persecuting them when they cannot openly restrain them. Thus he says, in secret, to show that this was done according to plan: "Truly, you are a hidden God" (Is 45:15). Augustine gives us another reason: to teach us that Christ was hidden in the figures of the Old Testament: "I will wait for the Lord, who has hidden his face (i.e., clear knowledge) from the house of Jacob" (Is 8:17); so, "Even to this day... a veil is over their hearts" (2 Cor 3:15). Thus everything that was said to this ancient people was a shadow of the good things to come, as we see from Hebrews (10:1). So our Lord went up in secret to show that even this feast was a figure. Scenopegia, as we saw, was the feast of Tabernacles; and the one who celebrates this feast is the one who understands that he is a pilgrim in this world. Another reason why our Lord went up in secret was to teach us that we should conceal the good things we do, not looking for human approval or desiring the applause of the crowd: "Take care not to perform your good actions in the sight of men, in order to be seen by them" (Mt 6:1).
Source: Commentary on John