Great Scott is an
exclamation, similar to "Oh God!" or "
Great Caesar's Ghost!".
It possibly became an exclamation during the
Civil War. Union General
Winfield Scott was considered better at self publicity than his skills as a military commander. General Scott, over proud he made the rank of
Major General at the age of 28, was so notorious for his swaggering attitude that his troops nicknamed him Old Fuss and Feathers. General Scott got so fat (over 300 lbs) enjoying the good life of a General, he couldn't ride a horse anymore. A General unable to mount a horse was not a real
confidence builder to the rank and file. So soldiers when told of foolish/dangerous/impossible orders from the General might have been given to exclaim "Great Scott!"
Much like
FUBAR, this military jargon eventually percolated into civilian use and it was a favored expression during the 1890s (the
Gay Nineties).