A surprisingly optimistic President Obama predicted that Republicans will undo just 15 to 20 percent of his policies when Donald Trump takes office in January — despite the president-elect’s vow to overturn all of his executive orders.

“Maybe 15 percent of that gets rolled back, 20 percent, but there’s still a lot of stuff that sticks,” Obama told the New Yorker.

He conceded that ObamaCare could take a hit.

“That has been a unifying bogeyman for Republicans over the course of the last six years,” the president said.

“In the minds of a lot of the Republican base, it is an example of a big government program designed to take something from them and give it to someone else who is unworthy.”

But, he added, if Trump and the GOP-controlled Congress only “modify but still maintain a commitment to provide health insurance for the people who received it, then a whole bunch of stuff hasn’t gone out the window.”

Obama also said he believed the Iran nuke deal — another frequent Trump target — would survive.

“We actually have over a year of proof, and you’ve got the Israeli military and intelligence community acknowledging that, in fact, it has worked,” he said.

“So, given that proof, I don’t think that it is inconceivable that Republican leaders look and they say, ‘This thing worked. Obama is no longer in office. This is not something that our base is hankering to undo, and we may quietly leave it in place.'”