Egypt appeals court reinstates top prosecutor sacked by Morsi