Marshal Nikolai Ogarkov, who was unexpectedly ousted as Soviet military chief of staff and first deputy defense minister last September, was reported by well-informed sources to have made a spectacular comeback in a recent unpublicized shake-up of the high command carried out by Soviet leader Mikhail Gorbachev.

According to the sources, Ogarkov, 67, has regained his post as first deputy defense minister and was appointed commander in chief of the Warsaw Pact forces.

His reported Warsaw Pact appointment means in effect that Ogarkov has regained one of the three top military slots in Moscow. Moreover, as first deputy defense minister he will be one of the main military policy makers.

The shake-up also involved the retirement of the commander of Soviet strategic forces, Marshal Vladimir Tolubko, and reassignment of the current Warsaw Pact commander, Marshal Viktor Kulikov. He was reported to have been assigned to head one of the military academies in Moscow.

Ogarkov, who is known for his intelligence, poise and extensive knowledge of strategic issues, was summarily ousted last September by the late Soviet leader Konstantin Chernenko. It is believed that Ogarkov had opposed Chernenko's conciliatory stand toward the United States that eventually led to the resumption of the Geneva arms talks. But it was unclear whether the return of Ogarkov reflected a revival of the hard line in the Kremlin.

Ogarkov also is reported to have favored a strengthening of the technological capacities of the Soviet Union's conventional forces while the official Soviet military position emphasized buttressing the Soviet Union's nuclear stockpiles. Ogarkov argued in an interview in May 1984 in the Soviet press that the deployment of U.S. intermediate-range missiles in Western Europe did not increase the possibility of a first strike against the Soviet Union. Both sides fully recognize the inevitability of a retaliatory strike, he said.

Because of the implied nuclear deadlock, he said, a modern conventional superpower war was more likely than a nuclear war. And he argued that the Soviet military must keep abreast of the latest conventional warfare technology.

Western analysts have speculated that differences between Ogarkov and others on the issue of stressing conventional rather than nuclear capacities may have prompted Ogarkov's ouster.

Although there was no official confirmation of the changes at the Defense Ministry, the sources said the shake-up was extensive and involved the retirement of a number of senior officers, including Col. Gen. Alexei Yepishev, 76, who was replaced as head of the political directorate of the armed forces by a younger general currently serving in East Germany.

Because of his age and poor health in recent months, the retirement of Yepishev was described by the sources as routine.

Ogarkov reappeared in public life last month when the Defense Ministry published his book, "History Teaches Vigilance." The book seemed to echo main propositions Ogarkov advanced in a 1982 book in which he called for greater preparedness for war -- not only of the armed forces and military industry but of all sectors of the Soviet economy.

Ogarkov argued on both occasions that the United States and its military doctrine pose the main threat to peace. Since the Reagan administration was trying to gain strategic superiority, Ogarkov argued, the Soviet Union would increase its "economic and defense" potential to counter such moves.

At the time of his ouster last September, an official statement said Ogarkov was relieved "in connection with a move to other duties" -- which were never disclosed. There have been reports that he was given charge of a largely theoretical western military theater without troops to command.

Ogarkov has been one of the most forceful advocates of military interests, frequently thought of as a future defense minister. Three months after his ouster, however, the defense minister at the time, marshal Dmitri Ustinov, died and was replaced by Marshal Sergei Sokolov, a career officer who commanded tank troops in World War II.

Ogarkov was replaced last September by Marshal Sergei Akhromeyev as chief of staff.

Kulikov, who is four years younger than Ogarkov, has served as Warsaw Pact commander since 1977.