The Frenchman looked certain to leave the Blues in January as he searched for playing time ahead of Euro2020.
But after winning playing time before matches were suspended in March, Giroud signed a new deal last week.
"I was supposed to leave in the January transfer window because I wasn't playing much and I needed more game time to make the France squad for Euro 2020," he told the club's website.
"I very nearly left the club but I really think that God wanted me to stay at Chelsea.
"The manager told me that he couldn't let me leave because he didn't have anyone to replace me. Everyone knows what happened so I won't go back over it but the coach spoke to me privately and told me that he'd give more games.
"He kept his word and what then mattered to me was proving to him that he could count on me when I was called upon."