As the Chida wrote, when one keeps Shabbat according to its law, even avodah zarah is forgiven him, for he acknowledges that Hashem created the world. The Chatam Sofer and the Maharal wrote likewise. But if he only says with his mouth that he believes, and does not express this in an act, the act nullifies his speech.