This paper presents a mixed-integer non-linear programming (MINLP) model for the optimal restoration/maintenance switching sequence of unbalanced three-phase electrical distribution systems. Once the protection coordination has identified and cleared a faulty zone, the proposed MINLP model determines the status of remotely controlled switches and the dispatchable distributed generation (DG) units, used to de-energized the troubled section of the network and supply as much load as possible. The restoration considers the switching sequence over a discrete horizon, guaranteeing that the operational constraints of the distribution system are not violated in every step of the sequence. Furthermore, a set of linearization strategies are presented to transform the proposed MINLP model into a mixed-integer linear programming (MILP) model. The use of MILP models guarantees convergence to optimality by applying convex optimization techniques. Tests are performed on an unbalanced three-phase radial distribution system consisting of 123 nodes, 12 switches, and three dispatchable DG units. The obtained results show that the proposed optimization model is a holistic procedure that can be used to efficiently manage power restoration or to minimize isolated areas in case of scheduled maintenance in modern electrical distribution systems.