The most simple way of learning it, is to tell the dog to lift the paw every time the lead is coming the wrong way. Indicate which paw the dog shall lift by tighten the lead there. The front paws are easy, but the back paws are more difficult to learn. Don't tighten the lead to high. You can also put a name on each paw.
Some dogs learn themselves after a year or two how to solve the problem.
Why shall you tangle out the lead when the dog can do it, if you only tell it to do. Don't make it to seriously the first time you train the dog by twisting the lead more then once around the pole. Make the dog walk behind you at the same time as you tell it to go behind. Do the same when you learn the dog to walk ahead. Start training with the dog lying on the ground, sit beside the dog with one of your hands at the back of the dog.