It can't work both ways, can it? LOL. See it doesn't really take a lot of logic to be an evolutionist, just a healthy dose of sophistry.
It didn't work both ways. There's an overview here, on the off chance you're really interested.
"The human foot still shows the tell-tale signs of our tree dwelling ancestry. But, its shape has changed to facilitate walking on the ground. There are many changes that I could talk about, but one of the more obvious is the adducted big toe. In humans the big toe (the hallux) has moved in line with the other toes (it is permanently adducted). This transforms the hallux into a propulsive organ (we push off with our hallux at each step), rather than a grasping organ. In most other primates the hallux is normally in an abducted position (out of line with the other toes), which allows it to grasp objects like the thumb.
"The loss of this grasping ability for the hallux is a key change in the evolution of human locomotion. "