Steve Huffman, co-founder and chief executive officer of Reddit Inc., speaks during a Bloomberg Technology television interview in San Francisco, California, U.S., on Wednesday, Nov. 9, 2016.

The most anxious day of Reddit CEO Steve Huffman's life was showing up to work on the Monday after Thanksgiving this year. The week before, he had thrown the company into a minor political crisis.

After weeks being antagonized by the users of Reddit communities like /r/The_Donald and /r/pizzagate, Huffman had covertly edited messages posted by other users that were critical of him, to instead be critical of those communities' leaders. On the latest episode of Recode Decode, hosted by Kara Swisher, Huffman said he conceived this as a prank, "in the spirit of fun."

More from Recode:

Recode Daily: Trump's tech summit RSVP list includes Tim Cook, Larry Page and Sheryl Sandberg

Want to get smarter about media, fast? Come see Ben Thompson at Code Media 2017.

Actually, Elon Musk might skip Trump tech summit

"I figured, I'm just going to mess with these bullies, and I actually have the capability of messing with them, so I'll do so," Huffman said. "I wanted to do something. I didn't do the right thing, but that was my mentality."

Huffman says the aftermath of this "prank," users questioning whether their posts had ever been edited without their consent in the past, was "devastating," and that he knows it will take time to rebuild trust within the community. At an all-hands staff meeting on that anxious Monday, he apologized directly to Reddit's staff and said he wanted them all to be proud to work there.

However, Huffman also said that Reddit is continuing to debate how to address what he sees as a "toxic minority" within groups like Trump supporters without removing the group as a whole.

"The irony is, they're on my platform. I've defended their right to be on our platform many times," he said. "I don't want to take your voice away. I just want you to stop being a_______s."

"I think you're seeing this play out in the country," Huffman added. "A toxic minority of people who are trying to re-normalize bigotry and bad behavior are undermining this message that 50 percent of country feels disenfranchised, is left out. Separating those two is not easy."

You can listen to Recode Decode in the audio player above, or subscribe on iTunes, Google Play Music, TuneIn and Stitcher.

If you like this show, you should also sample our other podcasts:

Recode Media with Peter Kafka features no-nonsense conversations with the smartest and most interesting people in the media world, with new episodes every Thursday. Use these links to subscribe on iTunes, Google Play Music, TuneIn and Stitcher.

features no-nonsense conversations with the smartest and most interesting people in the media world, with new episodes every Thursday. Use these links to subscribe on iTunes, Google Play Music, TuneIn and Stitcher. Too Embarrassed to Ask , hosted by Kara Swisher and The Verge's Lauren Goode, answers the tech questions sent in by our readers and listeners. You can hear new episodes every Friday on iTunes, Google Play Music, TuneIn and Stitcher.

, hosted by Kara Swisher and The Verge's Lauren Goode, answers the tech questions sent in by our readers and listeners. You can hear new episodes every Friday on iTunes, Google Play Music, TuneIn and Stitcher. And Recode Replay has all the audio from our live events, including the Code Conference, Code Media and the Code Commerce Series. Subscribe today on iTunes, Google Play Music, TuneIn and Stitcher.

If you like what we're doing, please write a review on iTunes — and if you don't, just tweet-strafe Kara.