Danny Kay said that “edited and misleading” manuscripts of a conversation between him and his accuser had been used by prosecutors to secure his 2013 conviction.
Derbyshire Police are now investigating how the deleted messages were overlooked, but Mr Kay said the “failure” meant something like this “could happen to anyone”.
“Even now, with the conviction quashed, I still can’t believe that it took years of pain and stress for this nightmare to end,” the 26-year-old told the Mail on Sunday.
“And the terrifying thought is that if the police and justice system could fail me like this, it could happen to anyone.”
Mr Kay said an inmate taught him how to recover deleted messages and he passed the information on to his sister-in-law Sarah Maddison, who logged on to his account.
Within minutes, she had found the archived messages, which were enough to launch an appeal process.
During his trial in 2013, the jury saw a message that showed Mr Kay apologising for “hurting” his accuser.
But messages in the conversation had been deleted and Mr Kay had actually been apologising for ignoring her.
Appeal judge Mr Justice Goss said: “We have come to the conclusion that, in a case of one word against another, the full Facebook message exchange provides very cogent evidence both in relation to the truthfulness and reliability of the woman.”
Derbyshire Police said: “We will be reviewing our investigation to find out whether lessons can be learnt.”
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies