John D. Rateliff, in his History of the Hobbit series, has the original chapter as well as an interesting commentary. I quote here the original version of The Hobbit as an addendum to the accepted answer.
After the first riddle, Gollum, in good faith, says he will give a present to Bilbo if he wins:
'Does it guess easy? - it must have a competition with us, my precious. If precious asks, and it doesn't answer, we eats it my precious. If it ask us and we doesn't answer, we gives it a present.'
Once Gollum loses the last riddle ("What have I got in my pocket?"), this is what originally happened:
'Both wrong!' said Bilbo very much relieved - and jumped to his feet and held out his little sword with his back to the wall. But funnily enough, he need not have been frightened. For one thing the Gollum had learned long long ago was never to cheat at the riddle-game. Also there was the sword. He simply sat and blubbered [> whimpered].
'What about the present?' said Bilbo, not that he cared very much; still he felt he had won it, and in very difficult circumstances too.
'Must we give it precious; yes we must - we must fetch it precious, and give it to the thing the present we promised.' So he paddled back into his boat, and Bilbo thought he had heard the last of him. But he hadn't. The hobbit was just thinking of going back up the passage (having had quite enough of the Gollum and that dark water-edge), when [Gollum came back >] he heard Gollum wailing and squeaking away in the dark [cancelled: on his island]. He was on his island (of which Bilbo, of course, knew nothing) scrabbling here and there, searching and seeking in vain, and turning out his
'Where is it, where is it' he heard him squeaking. 'Lost, lost, my precious, lost lost; bless us and splash us, we haven't the present we promised, and we haven't [added: even] got it for ourselves'.
Bilbo turned round and waited, wondering what it could be that the creature was making such a fuss about. This turned out very fortunately: For Gollum came back, and made a tremendous chatter and whispering and croaking; and in the end Bilbo [found >] understood, that Gollum had a ring, a wonderful beautiful ring, a ring that he had been given for a birthday-present ages and ages before in old days when such rings were less uncommon. Sometimes he had kept it in his pocket; usually he kept it in a little hole in the rock on his island; sometimes he wore it - wore it when he was very very hungry and tired of fish, and crept along the dark passages looking for stray goblins. Then (being very hungry) he ventured even into places where the torches were lit and made his eyes blink and smart; but he was safe. O yes quite [> very
nearly] safe; for if you slipped that ring on your fingers, you were invisible; only in the strongest sunlight could you be seen, and then only by your shadow, and that was [a faint >] only a faint shaky sort of shadow.
I don't know how many times Gollum begged Bilbo's pardon. And he offered him fish caught fresh to eat instead (Bilbo shuddered at the thought of it); [but somehow or other he had to >] but he said 'no thank you' quite politely.
He was thinking, thinking hard - and the idea came to him that he must have
found that ring, that he had that very ring in his pocket. But he had the wits not to tell Gollum. 'Finding's keeping' he said to himself; and being in a very tight place I think he was right, and anyway the ring belonged to him now.
But to Gollum he said: 'Never mind, the ring would have been mine now if you could have found it, so you haven't lost it. And I will forgive you on one condition'.
'Yes what is it, what does it wish us to do, my precious.'
'Help me to get out of these places', said Bilbo.
To this Gollum agreed, as he had to if he wasn't to cheat, though he would very much have liked to have just tasted what Bilbo was like. Still he had lost the game [> promised]; and also there was the sword, and also Bilbo was wide awake & on the look out, not unsuspecting as the Gollum liked to have things which he caught. That is how Bilbo got to know that the tunnel ended at the water, and went on no further on the other side, where the mountain wall was dark and solid. He ought to have turned down one of the side passages before he came to the bottom, but he couldn't follow the directions he was given to find it. So he made Gollum come and show him.
Rateliff says this:
This chapter, the most famous in the entire book, is paradoxically little-known in its original form. Only some 17,000 copies of the first edition were ever offered for sale [...]
We are thus faced with the amusing depiction of a monster who is considerably more honorable than our hero. For Bilbo soon realizes that he already has Gollum's treasure but goes ahead and demands a second prize (being shown the way out) in addition to the one he has quietly pocketed - a neat parallel to Gollum's earlier trick of 'working in two answers at once' on that final attempt to answer the last question.
The narrator, moreover, applauds his duplicity (' "Finding's keeping" he said to himself; and being in a very tight place I think he was right, and anyway the ring belonged to him now.') with spurious logic that sounds so much like special pleading that Tolkien eventually decided it was just that: Bilbo's own attempt, in writing this scene for his memoirs, to justify his claim to the ring.