"Great Scott!" is an interjection of surprise, amazement, or dismay. It is a distinctive exclamation, popular in the second half of the 19th century and the early 20th century, and now considered dated.
It originated as a minced oath, historically associated with two specific "Scotts": Scottish author Sir Walter Scott and, later, US general Winfield Scott.
It is a catchphrase of the fictional scientist Emmett "Doc" Brown from the Back to the Future franchise.