The most common explanation is that its origins lie in old directional commands for horses: "gee" (pronounced with a soft /g/ as in genie) to go right, and "haw" to go left. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.