THE NEW FACE Mikhail Gorbachev has put on Soviet foreign policy came up for judging in the United Nations the other day. The Soviets had spent a year preparing to blunt the annual condemnation they receive for their aggression in Afghanistan. Having anticipated last November the withdrawal of Soviet troops ''in the near future,'' Mr. Gorbachev had licensed the Soviet press to spread publicly -- and Soviet diplomats to spread privately -- hints of discontent with the war and of readiness to consider a political compromise to end it. Moscow's man in Kabul, Dr. Najib, had launched a program of ''national reconciliation'' and had spruced up some of the prisons enough to permit a first on-site inspection by a U.N. human rights investigator. A deflecting resolution was prepared for the General Assembly debate.

The whole effort collapsed. A year earlier, 122 nations had demanded immediate Soviet withdrawal. This year the figure was 123. There are political stirrings on the Afghan scene, and the human rights investigator, Austrian Felix Ermacora, found ''some improvements'' in government-controlled areas. To most people in Afghanistan, however, the Soviets remain brutal invaders, and the Afghans they have tried to prop up remain without legitimacy. To most members of the General Assembly, the Soviets are still killing in a foreign country. The ambassador of Iran, which the Kremlin is assiduously courting in another context, found the United Nations text weak -- for one thing, he complained, it did not name ''Soviet aggressor forces'' -- but noted that an invasion of one Islamic country constitutes an attack upon them all.

Mr. Gorbachev, it is said, needs a face-saver: a great power cannot simply call it quits, cut its own losses and abandon (or carry out to safety) Afghans who relied on it and whom it used. It is precisely the search for a face-saving middle ground, however, that now sustains the war. The Soviets have one possible alternative -- hoping that Afghan bombs or American antinuclear passions will limit the crucial support that Pakistan provides to the Afghan resistance. But otherwise they cannot avoid recognizing the dead end to which their own past choices have brought them. The United States pledges -- and the logic of the situation reinforces the pledge -- not to exploit a Soviet withdrawal for American strategic purposes. The Kremlin, however, must withdraw.