Facing an internal revolt, Hostess Brands will roll back pay raises it doled out to top managers just months before filing for bankruptcy.

The maker of Twinkies and Ding Dongs is slashing pay for its four highest-paid managers to $1 apiece until Hostess emerges from Chapter 11 or Dec. 31, whichever comes first.

In addition, CEO Gregory Rayburn said four junior execs will see their salaries reset to the amounts they were paid before last summer’s huge pay hikes.

“Those raises were the product of an assessment by our compensation committee and an independent compensation consulting firm and were meant to create stability while we sought to restructure the company,” Rayburn said in a letter to employees yesterday. “We are in different circumstances today.”

The move came after the company’s creditors slammed Hostess in court papers for jacking up managers’ salaries in July after it had already hired restructuring lawyers. Hostess hired advisers in March 2011 but didn’t file for bankruptcy until January.

The creditors accused Hostess of sidestepping rules designed to prevent distressed companies from paying big rewards to keep executives from bolting.

The disclosure put Hostess — already locked in tense negotiations with its unions over pension and health-care costs — at odds with rank-and-file workers who have gone without significant raises for years and had their 401(k)s frozen. Adding insult to injury, the company laid off 10 percent of its workers last summer.

“They are ripping us off from the top,” a Hostess salaried worker told The Post. “They eliminated all 401(k) matches in August while they got increases.”

A source familiar with the board’s thinking at the time said the raises were approved under former CEO Brian Driscoll. Hostess’ counsel and its restructuring adviser also reviewed the raises and believed they were legal, the source said.