The Senate broke a deadlock last night and approved controversial changes in the farm law enacted less than three months ago.

The package of changes, which include an exemption for dairy farmers from Gramm-Rudman-Hollings budget-balancing requirements, now goes to the House, where its fate is uncertain.

A House effort to adopt similar amendments to the 1985 law collapsed last week when urban members rebelled against the break for dairymen.

This week's Senate controversy arose from another issue, however -- Democratic insistence that any changes include liberalized credit to help farmers strapped for spring planting money.

Sens. Tom Harkin (D-Iowa) and John Melcher (D-Mont.), who led the credit push, relented last night and settled for a nonbinding resolution urging the White House to consider advance payment of crop-support loans, which ordinarily are not made until after harvest.

President Reagan last year vetoed a farm credit bill that contained a similar provision, and the administration sent word this time that it would not obey an order to make the low-interest loans early.

Harkin's resolution passed, 65 to 18, and Majority Leader Robert J. Dole (R-Kan.) and other farm-state senators said they hoped it would reemphasize to the administration the seriousness of the farm credit situation.

Last night's agreement included adoption of a House-passed emergency $5 billion appropriation to replenish the Commodity Credit Corp., which makes farm loans and finances surplus food purchases.

But the CCC, technically out of money yesterday afternoon, will not be able to resume its activities until Reagan signs the measure that emerges from a conference with the House.

The Agriculture Department plans to begin farm program signups today around the country. Signups were delayed Monday for want of congressional action.

Although the Senate deadlock centered on the credit issue, the exemption of dairy price supports from the Gramm-Rudman-Hollings budget rules promised more trouble for the farm package.

The USDA yesterday invoked an automatic 4.3 percent rollback in milk supports, cutting the price guarantee from $11.60 per hundredweight to $11.05. The package approved last night would return the price to $11.60 but increase dairy farmers' assessments.

The Senate agreement, approved by voice vote, included these other changes:

*Farmers who receive federal subsidies for removing land from production would not be allowed to plant unsubsidized crops there. Growers of such unsubsidized crops as vegetables and fruits had complained of unfair competition.

*Farmers whose subsidy payments are reduced because of a new formula for calculating crop yields would be compensated with surplus commodities from the CCC.

*Cuts proposed by the administration in farm export subsidies would be partially restored. Melcher, Harkin and others argued that the cuts ran counter to the administration's professed desire to recapture export markets.