Typical control systems on arms use muscles in the chest. The electrodes detect muscle impulses and move the arm accordingly. They don't move the existing nerves around or try to attach to them at all. In fact, while we can attach electrodes to nerve endings, the nerves die in a very short period of time (hours to days) and you have to cut them further back to get fresh nerves for the electrodes. So we still don't ever interface with nerves directly, except for short term studies.
But what they did here has two important differences: 1) they used the nerves that actually map to lower leg functions and 2) they attached them to different portions of the hamstring muscle.
Now they can use typical muscle sensing techniques to see nerve activity for the nerves that used to control the lower leg functions. He doesn't have to learn, "I want to close my hand, so that means I flex this particular chest muscle."
After connecting the nerves to the hamstring they probably went through a process where they hook the sensors to a computer, told him to move his ankle, toes, knee, etc, then mapped the sensor location to the right motor in software.
So, to him, moving his foot is just as simple as it was before it was amputated.