This was always the issue with the mind-swap when Slott explained it. It was really vague in Dying Wish when it first happened, and when Otto deleted Ghost Peter didn't make it any better. Slott never clearly established the rules from the start, and the post he made when issue 30 came out kinda proved it.
What he said, was that Peter didn't die in Otto's body, and actually managed to get his mind inside his body.
Except Otto was in control, so he could only watch.
When Otto "deleted" Peter he really removed access to Peter's memories, making Peter have those memory gaps, ie 31 memories remained.
When Peter saw the scene in 700, instead of rejecting those memories, he accepted them and regained access to all of them again.
It's one of those moments where the story became too plot heavy. If Dan Slott addressed it he would have given away the ending, yet it still wasn't clear what happened. You could easily make the argument that it was Peter the entire time who was brain washed by Doc Ock, who deleted Peter's personality, only to realize Peter's personality is what makes him the "Superior Spider-Man". Both logic work, because Peter never really died.