During a bombardment of a trench, a young soldier lies very still and prays steadily. He promises God that if he lives, he will tell the world about him. The soldier lives and rebuilds the trench. He never discusses God with anyone.
In war, Hemingway is illustrating, unbelievers turn to God. Any sort of support is helpful at that point. Later, this soldier does not live up to the promises he made because he is in a comfortable enough situation not to need religion as a crutch.