While Peter was fighting against Dr. Octopus, He realised that Peter was spider-man. Peter told him that the intelligence we had should have been used for good to others as Dr.Octopus had told him before. Then, Dr.Octopus felt sorry for what he had been doing,so he helped Peter to sort the problem that he had made and sacrifice for it.