WASHINGTON (AP) _ The hot-iron branding of cows' faces will not be required of dairy farmers to participating in the federal whole-herd buyout program, the Agriculture Department said Friday.

A federal court in Rochester, N.Y., on Wednesday ruled that the department could not require such branding but did not forbid the voluntary use of hot irons by farmers to mark their animals.

Undersecretary Daniel G. Amstutz said the program has been amended to allow dairy farmers to choose the alternative of freeze branding, which uses extreme cold to mark an animal's skin.

''However, if the hot-iron method is chosen, it is strongly recommended that an electrical thermostatically controlled branding iron be used,'' Amstutz said. ''This will provide uniform heat and will result in a better brand with less chance of accidental injury toi the dairy cattle.''

Further, he said, since branding - hot or cold - results in some pain to the animal, it is suggested that the area to be branded be desensitized in some manner, and that a veterinarian be consulted.

The dairy buyout program is aimed at reducing the nation's milk cow herd over an 18-month period by sending 1.55 million cows, heifers and calves to slaughter. Two-thirds of those are scheduled this spring and summer.

Farmers whose bids were accepted for the program must mark their animals permanently by branding them on the cheeks. The animals must be sold for slaughter or export. Their owners must agree to remain out of the dairy business for five years.

Department officials determined that only by branding could the dairy cattle be identified in a permanent, visible, recognizable way.

Other livestock producers have been concerned about the additional cow beef that will move into the market as a result of the slaughter, and Congress required USDA to buy 400 million pounds of red meat to help offset the cow beef.

Half of the purchases will be available for domestic feeding programs, half for export.

In a related development, Amstutz said the USDA will provide the Defense Department with up to 44 million pounds of meat between July 1, 1986, and Oct. 1, 1987. The meat will come from purchases made under the cow-buyout program, he said.