The House Ways and Means Committee, reversing a decision it made just last week, agreed yesterday to a provision that would raise the taxes of large commercial banks.

The action, part of the committee's tortuous overhaul of the tax code, marked a victory for Chairman Dan Rostenkowski (D-Ill.) and the tax-revision movement. It pulled the committee -- which will begin a three-day tax-writing weekend Friday -- out of a week-long stalemate.

"It puts everybody in a better mood," said ranking committee Republican John J. Duncan (Tenn.). "The chairman was smiling."

Last week, the committee voted 17 to 13 for an amendment that would have cut the taxes of banks -- which already pay a low rate -- and rejected Rostenkowski's proposal, which would have had the effect of raising taxes for most banks.

It was seen as a symbol of the committee's unwillingness to make tough decisions. Tax overhaul is expected to involve many decisions at least that difficult.

The sponsor of the original tax cut, Rep. Ronnie G. Flippo (D-Ala.), began yesterday's closed-door discussion, proposing to pare back his amendment so that banks would be taxed as they are now. At present, they can deduct money they set aside in a special fund to cover loans that go bad; Rostenkowski and President Reagan proposed permitting a deduction only for actual losses. The Flippo amendment approved last week would have let banks increase the amount they can put into the reserve for tax purposes.

Then Rep. Fortney H. (Pete) Stark (D-Calif.) called for taxing small banks as they are under current law, but restricting the deduction for the 450 largest banks in the nation. That would leave about 13,500 banks covered by the present system.

The committee accepted the change with an unrecorded show of hands. Only one Republican had voted against the new tax break (and thus with Reagan and Rostenkowski) last week; this time around, the vote was "much more" bipartisan, committee aides said.

"This tax reform is a big train traveling on a thin rail," said Rep. Byron L. Dorgan (D-N.D.). "Occasionally we come to a curve and don't make it, but we stop and put it back on the track."

The banking industry had no official reaction to the committee's move. But sources estimated that the affected banks control more than half of all banking assets, and that requiring different accounting methods for various banks was hardly simplification of the tax code.

Rostenkowski also announced that the committee will divide into smaller "working groups" to tackle four tax issues that show some potential for compromise -- small business, agriculture, tax-exempt bonds and low-income housing.

The chairman has told members he would like to finish as much as half of the massive tax overhaul during the weekend meeting. In a list of possible topics for discussion over the weekend, however, he omitted such controversial proposals as the one to curtail the deduction individuals claim for state and local taxes. He probably will tackle that toward the end of the process, aides said.

After yesterday's action, Ways and Means is still behind in its attempt to produce a tax plan that does not increase the federal budget deficit. The sum total of committee actions would produce about $7.2 billion less in tax revenue over five years than would the package before the committee. But the panel gained $6.1 billion by undoing most of what it did the previous week.

Also yesterday, the committee voted to exempt all credit unions from taxation; Reagan and Rostenkowski wanted to tax large ones. Accompanying this was an amendment that would raise the interest rate delinquent taxpayers must pay on their back taxes, among other changes related to back taxes. The net effect of the change would bring in about the same amount of revenue.