The movement to overhaul the tax code had its first skirmish with a powerful industry Tuesday, when members of the House Ways and Means Committee turned their attention to rewriting the taxes of commercial banks.

The banks won.

Both President Reagan and House Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.) had proposed curbing several deductions that together give the banking industry an effective tax rate of 6.4 percent. (In contrast, the average corporate tax rate is 16.7 percent, according to the Joint Committee on Taxation.)

When Tuesday's dust cleared, commercial banks not only had avoided the tax increase proposed for them, but Ways and Means had given them a tax cut. An amendment proposed by Rep. Ronnie G. Flippo (D-Ala.) passed the committee not once, but three times, over Rostenkowski's angry objections.

The first vote on overhauling business taxes, part of a package that members have agreed cannot increase the federal deficit, would result in reducing bank taxes by $4.8 billion over five years.

The committee did vote to curtail other tax deductions affecting banks and other financial institutions. But the net effect of the committee's actions was hardly an auspicious beginning for the hundreds of amendments on business taxes that Ways and Means will consider.

"I think tax reform is moving one step forward and two steps back," said John E. (Buck) Chapoton, former assisant secretary of the Treasury for tax policy. "You try and do something and the first major business decision that comes up, they go the other way. That is really a bad omen."

The success of the amendment came as a surprise to legislators, including Flippo. It was approved on a voice vote, a show of hands and then a 17-to-13 roll call.

Of the 17 committee members who voted for the amendment, eight were Democrats and nine were Republicans. Of the 13 who voted on the side of Reagan and Rostenkowski, 12 were Democrats and only one -- Rep. Willis D. Gradison Jr. of Ohio -- was a Republican.

"I don't think it's our duty to be responsive in every instance to the president," said ranking Republican John J. Duncan of Tennessee. "We will consider his suggestions, but no members should be subservient to everything the administration asks for."

The provision that the committee approved has been the subject of political debate -- and bank lobbying -- for more than 50 years. Ever since the end of the Great Depression, banks have been required to set aside certain sums of money in "reserves" to cover loans that go bad. But banks are allowed to deduct the money when they put it in their reserves, thus reducing their taxes. Banks are allowed to hold only a certain percentage of the total amount of their outstanding loans in reserves.

In general, companies cannot deduct business losses until they occur. For that reason, the Reagan and Rostenkowski tax proposals both recommend barring banks from deducting their reserves until loans actually go sour.

The Flippo amendment would increase permissible reserves -- and thus the deduction -- from the current level of 0.6 percent of outstanding loans to 1.5 percent.

Banks contend that the amendment is merely consistent with the requirements of bank regulatory agencies.

"We think it better matches to the economic reality of a bank's taxes," said Charles Wheeler, tax counsel to the American Bankers Association. "It's not a question of a shelter or a loophole."

Wheeler also pointed out that the committee voted to toughen a provision relating to tax-exempt bonds that will raise banks' tax rates far more than the Rostenkowski bad-debt proposal would have. But congressional tax experts said that the net effect of Ways and Means actions so far on financial institutions would still cut tax revenues.

Banking lobbyists standing by the closed doors of Room 1100 of the Longworth House Office Building gasped in astonishment when they found out what the committee had done. But their political action committees had been at work long before the deliberations began.

In the first six months of this year, commercial banks' PACs gave $33,025 to Ways and Means members, a 79 percent increase over the first six months of 1983, a comparable period in the election cycle. According to the self-styled citizens' lobby Common Cause, bank PACs contributed $216,377 to Ways and Means members during 1983 and 1984.

Some of the Ways and Means members with substantial contributions from bank PACs voted against the Flippo amendment. Rep. Sam Gibbons (D-Fla.), for instance, has received $4,000 from bank PACs so far this year, according to Federal Election Commission records.

But some members voting with the banks have received sizable bank contributions. Duncan, for example, has received $4,500, Rep. James R. Jones (D-Okla.) has received $5,000, and Flippo -- an accountant by profession -- has received $2,000.