Spurred by a personal appeal from President Carter, Egyptian President Anwar Sadat yesterday reversed his decision of Friday night to recall his chief negotiators from the Middle East peace talks here.

Sadat's about-face followed a hurried, middle-of-the-night exchange of messages between the two leaders. Carter urged him to leave the negotiators in Washington, and yesterday morning the Egyptian president replied that he was acceding to Carter's request.

It was the second instance of Carter intervening dramatically in the roller-coaster course of the talks to keep them moving toward the goal of an Egyptian-Israeli peace treaty.

Last weekend, as Israel was recalling its negotiators, Carter stepped in and brought the two sides together in a meeting that resulted in last Sunday's announcement of tentative agreement on the main elements of a treaty.

In ensuing days, though, the optimism sparked by Sunday's accord was eroded by a resurgence of problems involving the relationship of an Egyptian-Israeli peace to the separate, but highly sensitive, issue of the future status of the Israeli-occupied West Bank of the Jordan River.

Both the Israeli and Egyptian governments expressed dissatisfaction with the draft treaty's language establishing a linkage to the West Bank question and said they would seek to have it changed. However, the changes sought by each side reportedly are in direct conflict.

Then, the situation was exacerbated by Israel's decision to expand its settlements on the West Bank. That move triggered anger in Cairo and Washington because it could make Sadat vulnerable to charges that he is ignoring the interests of the West Bank's Palestinian inhabitants by moving toward a separate peace with Israel.

Increasing Egyptian concern over these developments resulted in Prime Minister Mustapha Khalil's announcement to a press conference Friday night in Cairo that the two top Egyptian negotiators, Defense Minister Kamal Hassan Ali and acting Foreign Minister Boutros Ghali, were being summoned home for consultations.

Various sources connected with the talks yesterday gave this account of what happened next.

When the first word of Khalil's announcement reached Washington, the two Egyptians were in a meeting at the State Department with Secretary of State Cyrus R. Vance. He was trying to get the chief Israeli and Egyptian negotiators into new face-to-face talks following a six-day pause while their governments examined the draft treaty.

Vance immediately called Carter, who instructed him to send Sadat a message on the president's behalf stressing the U.S. belief that it was important for the Egyptians to remain at the talks.

Hassan Ali also called Cairo and informed officials there that, in light of the talks the Egyptian delegation heads had with Vance Friday night, he believed that he and Boutros Ghali should stay.

Sadat's reply was relayed to Washington through the State Department early yesterday. During a campaign appearance in Buffalo, N. Y., later in the day, Carter described Sadat's response in this way:

"I contacted President Sadat last night (Friday) and said. Leave your negotiators in Washington. He sent me word this morning. I will do what my friend Jimmy Carter asked me. They are going to stay there and negotiate."

In the wake of the Egyptian change of course, Vance paid separate calls yesterday on the Egyptian and Israeli delegations at the Madison Hotel, where both are staying.

Sources connected with the negotiations said the informal talks centered on proposed changes in the draft treaty, with special emphasis on resolving the disputes about the West Bank linkage problem. The sources cautioned, however, that Vance's visit did not mean there will be an immediate resumption of top-level bargaining between the Israelis and the Egyptians.

Egypt, which is sensitive to concern in the Arab world that it not abandon the interests of the 1.1 million Palestinians in the West Bank and Gaza Strip, has insisted that the treaty contain a reference to the need to resolve the status of these areas.

Israel, citing the agreement at the Camp David summit that these issues should be kept separate, has argued that the West Bank and Gaza Strip should be dealt with in another forum after the present talks with Egypt are concluded.

The draft treaty hammered out by the delegations here last Sunday contained compromise language that reportedly calls attention to the West Bank problem without setting up an explicit legal tie to the Egyptian-Israeli peace agreement.

However, both the Sadat government and Israeli Prime Minister Menachem Begin's cabinet have said they want the compromise language amended further. The problem is that the Egyptians want to strengthen the linkage language, while the Israelis seek to weaken it.

After meeting with Vance Friday night, Israeli Foreign Minister Moshe Dayan described the differences between the two countries as "major" and said they would take "a lot of good will" to resolve.

Although sources involved in the negotiations described yesterday's events as generally providing a basis for new optimism, there was one discordant note. It stemmed from the sharp public clash between U.S. and Israeli officials touched off by Israel's decision to expand its West Bank settlements.

At the time, Dayan and other Israeli officials criticized Assistant Secretary of State Harold Saunders for statements that they characterized as undermining Israel's right to have its citizens live on the West Bank.

The attacks on Saunders are known to have caused great anger within the State Department, and yesterday Vance took the unusual step of speaking out publicly in Saunders' defense. He issued a statement saying:

"I deplore the personal attacks on Assistant Secretary Harold Saunders in connection with his recent conversations in the Middle East. Mr. Saunders is an outstanding public servant who has had more than a decade of experience in dealing with the problems of the Middle East, and I have the utmost confidence in him."