KHARTOUM—Sudan’s military reinstated Prime Minister Abdalla Hamdok on Sunday and promised to release all political detainees after weeks of deadly unrest triggered by a coup, although large crowds took to the streets to reject any deal involving the army. Under an agreement signed with military leader General Abdel Fattah al-Burhan, Hamdok, first appointed after the overthrow of autocrat Omar al-Bashir in a 2019 uprising, will lead a civilian government of technocrats for a transitional period. The deal faces opposition from pro-democracy groups that have demanded full civilian rule since Bashir’s ouster and have been angered by the deaths of dozens of protesters since the Oct. 25 coup. A hero for the protest movement, Hamdok quickly became the villain for some. “Hamdok has sold the revolution,” protesters chanted after the deal was announced. The Sudanese Professionals Association (SPA), a leading protest group, called it “treacherous.” Tens of thousands of people joined …