Restore logic done, yet not tested.