Get lost! dates from at least 1944 in popular media, and in speech is likely to pre-date this somewhat.
1945
Here's a 1945 in the script for Anchors Aweigh! by Isobel Lennart, also a 1945 film:
AL: Squeaky, get back out there and... and... look for thugs.
JARVIS: Thugs, your--?
AL: Am-scray, Squeaky. Get lost. (JARVIS EXITS RIGHT)
1944
It shows up in Billboard, 15 April 1944:
Class?
NEW YORK, April 8--A society gal, breaking in a new role as secretary in one of the local agencies, informed her boss that a certain performer wanted to see him.
"I'm too busy," said the percenter. "Tell that jerk to get lost."
The socialite - secretary went back and told the actor, "Mr. So-and-So is busy. He says for you to get lost."
Snippets of I Never Left Home (1944) by Bob Hope (snippets can have incorrect metadata, but this seems correct):
If I picked a nice parlay of three or four out-of-line cracks to hand to the whole British press, the American Embassy might suggest I get lost.
And from the same book, perhaps literal, but perhaps a Bob Hope half-joke:
It was like breaking sticks to get lost. The population doesn't help you much, either. They want you to get lost. And stay lost. To them everybody on the road they don't know is a probable Nazi spy.
Another possible 1944 is in Best stories of modern Bengal, Volume 1 by Dilip K. Gupta:
"Then that's all right. Tell her to get lost again." Brindaban said, "To tell the truth, that's what Haripada also would prefer. Oh, the scandal! It'll just be complete if she turns a prostitute! Then Haripada won't be able to show his face in Calcutta! Even some of his friends will visit her!"
1942
"Let's Get Lost", a torch ballad by Frank Loesser and Jimmy McHugh (sung here by Lina Romay, but also by Jimmy Dorsey, and by Mary Martin in the 1942 film Happy Go Lucky, and later by Frank Sinatra), was popular in 1943 and often in Billboard's top ten. It goes:
Let's get lost, lost in each other's arms
Let's get lost, let them send out alarms
And though they'll think us rather rude
Let's tell the world we're in that crazy mood
Although not directly using the imperative idiom, I think it's suggestive of it and likewise helped popularise it.
The etymology is disputed and linguists do not seem to have a consensus.
Michael Quinion lists a number of implausible reasons and finally ends it with the first clear sighting of the word. This seems to be the closest we could get to a verifiable origin.
“Now there’s the kind of a man! Stout as a buffalo an’ as to looks I’d call him, as ye might say, real copasetic.” Mrs. Lukins expressed this opinion solemnly and with a slight cough. Its last word stood for nothing more than an indefinite depth of meaning.
A Man for the Ages, by Irving Bacheller, 1919.
Best Answer
The term greenfield was originally used for development projects on land that had never been built on.
In heavy industry, a greenfield project is a construction project to build a new oil well, refinery, chemical plant, etc. on a piece of land not previously used for that purpose, regardless of whether the land had been previously developed. For example, if you buy a junkyard and then build a natural gas processing plant on it, the new plant is a greenfield site even though the land was not green before you built on it.
A greenfield project is more complicated than a brownfield project, which is a project to expand capacity at an existing site: land and easements have to be sought, contracts for sale and transport of raw materials and finished product have to be negotiated from scratch, and the necessary licenses and permits are more numerous and difficult to obtain.
A related use of greenfield/brownfield occurs in the name of a US law: the "Brownfields law", signed by George W Bush in 2002, which limits liability for cleanup of "brownfield" sites for new owners. In the context of the law, a "brownfield" is a piece of land that formerly had polluting activities on it, and the land still has soil or water contamination that must be cleaned up.
If I could wager a guess, it would be as follows: the terms were first in use by business people in the heavy industry sector in a way that was only slightly metaphorical. Land at "greenfield" project sites could be truly green, but it could also be repurposed. Business people removed from heavy industry (e.g., financiers) began to use the term for its connotation of extra effort and complexity when talking about a capital project. Those factors are relevant for them even if their work doesn't involve buying land and building on it.