But the final decision did come after the president-elect’s Twitter posts, underscoring his sway over House Republicans who had moved ahead despite objections and warnings about the optics of the change from Speaker Paul D. Ryan and Representative Kevin McCarthy of California, the majority leader.

House Republicans might have amusedly applauded Mr. Trump’s cutting tweets when they were aimed at the news media and other common foes, but they found them measurably less funny when the criticisms were directed their way, raising alarms among Republicans about his power to corral them via social media. Following the decision to reverse course, several lawmakers were quietly fretting that Mr. Trump’s megaphone was much more powerful than they had realized.

Other Republicans both on and off Capitol Hill were wondering how the rules-change proposal got as far as it did, given the stated reservations of Mr. Ryan and Mr. McCarthy among others. They said it did not bode well that the rank and file was so willing to ignore leadership on such a potentially critical matter, demonstrating once again how hard it can be to manage the House Republicans even when the party is set to control both Capitol Hill and the White House.

Mr. Ryan had already headed off an earlier rules change that was deemed potentially embarrassing: a proposal to let lawmakers resume funding of pet projects through designated “earmarks” as long as the money went to public entities. Abuse of earmarks was one of the main sources of congressional corruption that led to tighter ethics rules and a ban on such spending, and Mr. Ryan and his allies believed that a quick move to restore them so soon after Mr. Trump’s election would not send the proper signal. But Mr. Ryan has promised to revisit both the earmark issue and the revisions to the Office of Congressional Ethics later this year.

The ethics office was created in 2008 at the urging of Representative Nancy Pelosi, the California Democrat who was then the House speaker. This was in response to criticism that the Select Committee on Ethics, comprising lawmakers from both parties, was ineffective, given a string of high-profile corruption cases and other breakdowns such as a scandal involving teenage House pages.