From livescience.com:

For years, there has been clear scientific consensus that Earth’s climate is heating up and that humans are the culprits behind the trend, says Naomi Oreskes, a historian of science at the University of California, San Diego.

A few years ago, she evaluated 928 scientific papers that dealt with global climate change and found that none disagreed about human-generated global warming. The results of her analysis were published in a 2004 essay in the journal Science

But even if there is a consensus, how can scientists be so confident about a trend playing out over dozens of years in the grand scheme of the Earth’s existence? How do they know they didn’t miss something, or that there is not some other explanation for the world’s warming? After all, there was once a scientific consensus that the Earth was flat. How can scientists prove their position?

Contrary to popular parlance, science can never truly “prove” a theory. Science simply arrives at the best explanation of how the world works. Global warming can no more be “proven” than the theory of continental drift, the theory of evolution or the concept that germs carry diseases.

“All science is fallible,” Oreskes told LiveScience. “Climate science shouldn’t be expected to stand up to some fantasy standard that no science can live up to.”

Instead, a variety of methods and standards are used to evaluate the viability of different scientific explanations and theories. One such standard is how well a theory predicts the outcome of an event, and climate change theory has proven to be a strong predictor…The effects of putting massive amounts of carbon dioxide in the air were predicted as long ago as the early 20th century by Swedish chemist Svante Arrhenius…“Why don’t you trust a psychic? Because their predictions are wrong,” he told LiveScience. “The credibility goes to the side that gets these predictions right.”

…Besides their successful predictions, climate scientists have been assembling a “body of evidence that has been growing significantly with each year,” Mann said...Isaac Newton had something to say about all this: In his seminal “Principia Mathematica,” he noted that if separate data sets are best explained by one theory or idea, that explanation is most likely the true explanation.