Restarting will temporarily disable Pegasus but it can’t remove it permanently. It is also believed that you can not get rid of this spyware even by factory reset method. In such a situation, the only option left is to change your smartphone.