PepsiCo has wisely retreated, tail ’tween its legs, from its effort to use “protest fever” to sell soft drinks.

It was an epic fail in trying to be cool. The YouTube ad opens with Kendall Jenner posing for a photo shoot near a (carefully generic) protest. She opts to join in, pulls off her wig and joins the masses — then grabs a Pepsi and hands it to a police officer, who drinks it while everyone else cheers.

Sure, we’ve had our issues with Black Lives Matter, but we don’t blame the activists for their fury at the idea that peace requires nothing more than a supermodel and a soda.

And not just BLMers: Bernice King, the daughter of Martin Luther King Jr., tweeted, “If only Daddy would have known about the power of #Pepsi” — with a picture of her father being pushed back by a line of cops.

“This is a global ad that reflects people from different walks of life coming together in a spirit of harmony,” ran Pepsi’s defense.

Sorry, no, that was Coke’s 1971 “I’d like to teach the world to sing” ad. This was just a bid to use a member of the Kardashian clan to cash in on an entirely different trend.

Mercifully, Pepsi finally pulled the plug — which still made it a great day for Coke.