The opportunistic pathogen Pseudomonas aeruginosa explores surfaces using twitching motility powered by retractile extracellular filaments called type IV pili. Single cells twitch by successive pili extension, attachment and retraction. However, whether and how single cells control twitching migration remains unclear. We discovered that P. aeruginosa actively directs twitching in the direction of mechanical input from type IV pili, in a process we call mechanotaxis. The Chp chemotaxis-like system controls the balance of forward and reverse twitching migration of single cells in response to the mechanical signal. On surfaces, Chp senses type IV pili attachment at one pole thereby sensing a spatially-resolved signal. As a result, the Chp response regulators PilG and PilH control the polarization of the extension motor PilB. PilG stimulates polarization favoring forward migration, while PilH inhibits polarization inducing reversal. Subcellular segregation of PilG and PilH efficiently orchestrates their antagonistic functions, ultimately enabling rapid reversals upon perturbations. This distinct localization of response regulators establishes a signaling landscape known as local-excitation, global-inhibition in higher order organisms, identifying a conserved strategy to transduce spatially-resolved signals. Our discovery finally resolves the function of the Chp system and expands our view of the signals regulating motility.