Then (v 7), we see the words of Christ, which show that this action is a mystery. Christ said to Peter: What I am doing you do not know now, but afterward you will understand. This action is both an example and a mystery. It is an example of humility to be practiced: "For I have given you an example, that you also should do as I have done to you" (v 15) And it is a mystery because it signifies an interior cleansing: "He who has bathed does not need to wash, except for his feet" (v 10).
So what Christ said can be understood in two ways. In one way, What I am doing you do not know now, that is,... you do not now understand that what I am doing is an example; but afterward you will understand, when he explained it to them saying: "Do you know what I have done to you?" (v 12). In another way, What I am doing you do not know now; that is to say, this is a mystery and something hidden, and it signifies an interior cleansing which only I can accomplish, and which you do not understand now, but afterward you will understand, when you receive the Holy Spirit: "I have yet many things to say to you, but you cannot bear them now. When the Spirit of truth comes, he will guide you into all the truth" (16:12).
Source: Commentary on John