Foreign policy has an interesting article "How Morsy Could Have Saved Himself". According to the author Morsi should have co-opted the old guard:
But whereas Egyptians tossed their dictator in jail and tore up his ruling party, Indonesians pursued a different, gentler path. Suharto -- a man every bit as corrupt as, and considerably more brutal than, his Egyptian counterpart -- was allowed to live out his days in luxury, and his old ruling party, Golkar, was not only allowed to persist (reliably capturing about 20 percent of the vote in legislative elections), but has been included in every post-Suharto cabinet but one. Indonesians may not have satisfied their powerful desire for justice, but their willingness to forgo retribution and work with supporters of the old regime is what allowed that country's nascent democracy to take root despite its endemic poverty and vast ethnic diversity.
That is how democratic revolutions should be done.
In this context this article (Egypt's "road not taken" could have saved Mursi) is also interesting. It tells about an EU initiative about a month before the coup to reconcile the sides.