南辕北辙

nán yuán běi zhé

to act in a way that defeats one's purpose (idiom)

nán

south

yuán

shaft of a cart or carriage

běi

north

zhé

rut; track of a wheel (Taiwan pr. [che4])