The Health, Education and Welfare Department has reversed an earlier decision and agreed to give states their fully July share of Medicaid and welfare money.

Twenty-three states and the District of Columbia were about to seek an emergency court order yesterday to block the reductions when government attorneys announced that HEW had changed its plans.

The department had announced earlier that effective Sunday it would cut $831 million from its payments to states for Medicaid and Aid to Families With Dependent Children (AFDC) program in response to a congressional directive.

Congress told HEW officials to trim $1 billion from programs where abuses have been identified, including Medicaid and welfare. Department officials say they already have achieved$169 million of the cut in student loan programs.

Charles A. Miller, attorney for 20 states and the District of Columbia, told U.S. District Judge Harold H. Greene that the July payments would avert the crisis but not end the threat of a cutback in August and September.

However, Justice Department attorney Nell H. Koslowe suggested the comptroller general authorize HEW to borrow money from its appropriation for the fiscal year beginning Oct. 1. A congressional conference committee meeting July 10 and July 11 could provide the same authorization, he said.

A third possibility, he said, is an eventual ruling by Greene that the $831 million should not be withheld. Greene said he would hear arguments on the cutback issue July 11.