Leg it British informal slang
To run very fast, especially to escape from someone or something
The robber legged it down the road when he heard the siren.
Hearing the dog growling, he decided to leg it.
We better leg it or we will be late.
To escape from the statement saying that someone is guilty of a crime or of doing something wrong or evade impeachment without being responsible for any sentence or punishment
To flee or run
To quickly and recklessly go or move round somewhere
To leave at a favorable moment
The verb "leg" should be conjugated according to its tense.
The idea of the idiom may come from the fact that you need to use your legs to run.