It’s déjà vu all over again. President Trump has given the hanging party a first-rate piece of rope to use against him.

His tweet will not live in infamy, but his cringe-worthy “go back” language rhymes with many of his earlier self-inflicted mistakes. The pattern was established during the 2016 campaign and he has been faithful to it many times since taking office.

It always seems to happen when things are going pretty well. So it was Sunday, with Democrats engulfed in a vicious civil war and Trump’s poll numbers rising against the 2020 candidates as the public begins to realize how far left they are going.

Indeed, things were so relatively tranquil that the media’s perpetual outrage machine was out of grist. Then suddenly, Trump fired at his opponents and shot himself in the foot.

Instantly, the political world goes crazy, the media is over the moon with its new ammunition against the president they loathe and tempers immediately reach the boiling point.

This is it, the Trump-haters insist. This time he has gone too far and there is no coming back. He’s toast, finished, the end. Whoopee!

And then it’s over. The news cycle moves on in search of fresh meat, the president turns down the volume without admitting a mistake or apologizing and the comment — it’s always a comment — gets consumed into the fatberg of Yesterday’s News.

This time might be different, but most likely it isn’t. Unless the entire nation has lost its mind, the Republic will not be destroyed by a tweet.

That’s not to suggest the president hasn’t harmed himself and his cause. While I don’t believe his tweet reflected racial intent, enough reasonable people believe it did and so a cleanup is in order.

The best course would be for him to signal regret, to acknowledge it was a tweet too far. People of goodwill — the vast majority of Americans — will not see it as a surrender to the mob. Quite the contrary.

It will let them close the books on the incident, which is good for the president and the country.

Trump doesn’t agree.

“I just feel these people hate our country,” he told me in a brief phone interview Tuesday night. “I think people understand that we want people who love our country and are capable of loving our country.”

When I raised the troubled history of the words “go back,” which were often used as insults against African-Americans and immigrants, including Jews, he responded that he has “pages and pages of statements” made by the four House members in question that he called “filthy” toward America and Israel.

“These people are haters, they probably hate our country, that’s my opinion,” the president said. While he conceded he might be wrong about public reaction, he believes “most Americans are glad to have somebody speak up for them.”

There is no doubt that Trump has benefited from the Dems’ civil war and comes off especially well against the far-left rookies. The more they talked at their Monday press conference, the better he looked.

Their sense of self-importance is astounding and their radicalism is chilling. Two of them, Reps. Ilhan Omar and Rashida Tlaib, have convinced me they are unrepentant anti-Semites and so anything they say is suspect.

A third, Rep. Ayanna Pressley, refused to call Trump “president,” saying he was the “occupant” of the White House. Who does she think she is, Hillary Clinton?

That leaves Rep. Alexandria Ocasio-Cortez, who last week blasted Speaker Nancy Pelosi for singling out the four “women of color” and her aide likened current Dem leaders to southern segregationists.

So the race card is at the top of their deck, ready to be played against fellow Dems as well as Trump. Other ridiculous claims, such as that border detention facilities are “concentration camps,” show why it is not unreasonable for Trump to paint them as unpatriotic.

Still, it was a mistake to say they “originally came from other countries,” when only Omar was born abroad. And by telling them to “go back,” he gave his divided opponents a fresh reason to unite against him.

Earlier Tuesday, he defended himself, saying “Those Tweets were NOT Racist. I don’t have a Racist bone in my body!”

Later he tried to refocus his criticism, telling White House reporters the four Dems “could leave, or they could stay, but they should love our country.”

The president should end the frenzy and clear the air by acknowledging the wider perception and, with modesty, emphasize that he had no racial intent.

Naturally, even that would not satisfy the radicals and their media handmaidens. But Trump should take that path now because presidents have an obligation to speak to the nation as a whole, especially in times of rancor, and because he needs a reservoir of goodwill to weather next year’s brutal campaign.

While the wacky “Squad” is no threat to him, Dems will nominate a candidate who will run on uniting the country. Incidents like this will be Exhibit A against the president.

Joe Biden already talks about national unity as part of his plan to capitalize on the belief that he is the most electable. In effect, it’s the general election strategy that Barack Obama used with success in 2008.

Unfortunately, Obama then spent eight years deepening the polarization. Trump is his legacy.

At this point, Trump stands a good chance of getting four more years, but nothing is guaranteed. And there is still the matter of Congress. If the GOP holds the Senate and takes back the House, the second term could be historically productive.

The border crisis could be dealt with through legislation that finally fixes the crazy-quilt pattern of laws that invite and reward illegal crossers. Renegotiated trade deals would have an easier time of winning approval and juicing the economy even higher. And the president could continue to staff the courts with constitutional conservatives.

On the other hand, if Dems hold the House and take the Senate, nothing gets done. Even worse, impeachment, with Senate conviction, becomes politically possible.

In short, Trump has everything to gain and nothing to lose by doing what he can to hush the hysteria. Besides, eating a little crow now is better than having to swallow the whole bird later.