The track became one of Justin Bieber's biggest hits.
"That was a song I had written for '÷'. It just wouldn't have made it," Sheeran said in an interview on Monday.
He said Justin's input had made the Grammy-nominated song "what it is".
"So going from a song that would have never been released to [being] the biggest song of last year - it just became Billboard's #1 of 2016 of the whole year, and nominated for Song of the Year at the Grammys - it just shows you that you shouldn't always write stuff off," he said.