During supper, when the devil had already put it into the heart of Judas Iscariot, Simon's son, to betray him,
(John 13:2 )
For he knew who was to betray him; that was why he said, “Not all of you are clean.”
I am not speaking of all of you; I know whom I have chosen. But the Scripture will be fulfilled, ‘He who ate my bread has lifted his heel against me.’
The message is clear. Jesus did not wash Judas' feet and then wish he could take it back after Judas betrays him. Jesus washed Judas' feet knowing full well what Judas was about to do. That's loving your enemy.