A lost chapter of Charlie and the Chocolate Factory, deemed too wild, subversive and insufficiently moral for the tender minds of British children almost 50 years ago, has been published for the first time.

The chapter, in Saturday's Guardian Review, with new illustrations by Sir Quentin Blake, was found among Dahl's papers after his death. It was chapter five in one of many early drafts of the book, one of the best-loved children's books, but was cut from the version first published in the US in 1964 and in the UK in 1967.

In the chapter Charlie Bucket – accompanied by his mother, not his sprightly grandfather – and the other children are led into the Vanilla Fudge Room, where they face the sinister prospect of the Pounding and Cutting Room.

"In the centre of the room there was an actual mountain, a colossal jagged mountain as high as a five-storey building, and the whole thing was made of pale-brown, creamy, vanilla fudge," the chapter reads. "All the way up the sides of the mountain, hundreds of men were working away with picks and drills, hacking great hunks of fudge out of the mountainside … As the huge hunks of fudge were pried loose, they went tumbling and bouncing d own the mountain and when they reached the bottom they were picked up by cranes with grab-buckets, and the cranes dumped the fudge into open wagons."

The chapter reveals the original larger cast of characters, and their fates, as well as the original names of some of those who survived into later drafts. Dahl originally intended to send Charlie into the chocolate factory with eight other children, but the number was slimmed down to four. The narrator reveals that a girl called Miranda Grope has already vanished into the chocolate river with Augustus Pottle: she is gone for ever, but the greedy boy was reincarnated as Augustus Gloop.

Timmy Troutbeck and "a rather bumptious little boy called Wilbur Rice", backed by their vile parents, shout abuse at Willy Wonka's warnings, scramble into the wagons, and are carried off through a hole in the wall.

"That hole," said Mr Wonka, "leads directly to what we call the Pounding and Cutting Room. In there the rough fudge gets tipped out of the wagons into the mouth of a huge machine. The machine then pounds it against the floor until it is all nice and smooth and thin. After that, a whole lot of knives come down and go chop chop chop, cutting it up into neat little squares, ready for the shops."

High on the mountain, the workers – who have not yet become the Oompa Loompas – sing "Eight little children, such charming little chicks. But two of them said 'Nuts to you', and then there were six."

Not surprisingly, no more is ever heard of Masters Troutbeck and Rice.

Dahl was living in the US after working for British intelligence at the end of the war, a successful author for adults - his 1960 collection, Kiss Kiss, went straight into the New York Times bestseller list - and married to the film star Patricia Neal, when he began writing for a younger audience based on the tales he was telling his own children. James and the Giant Peach was published in 1961, and by then the first draft of Charlie – in which the title character falls into a vat in a sweet factory and becomes a chocolate figure – had been discarded after Dahl's young nephew said it was rubbish.

He abandoned the book after his four-month-old son Theo almost died when his pram was hit by a taxi in New York, and the following year his seven-year-old daughter Olivia died of measles.

When he resumed work, his agent, Sheila St Lawrence, suggested that the workers should become "something more surprising" and added that she wanted "more humour, more light Dahlesque touches throughout". Violet Strabismus, nee Glockenberry, would become Violet Beauregarde, Elvira Entwhistle would return as Veruca Salt, and the mint grass meadow, the chocolate waterfall and the Oompa Loompas would soon appear in later drafts.

The book sold 10,000 copies in its first week and has never been out of print: "He lets his imagination rip in fairyland," the New York Times said. The book has never been out of print. It has been filmed twice, with Gene Wilder and Johnny Depp as the Wonkas, become an opera, and is also a current hit West End musical which opened in June 2013 and is now booking into late next year.

Like his first book for children, James and the Giant Peach, it initially struggled to find a UK publisher. Dahl blamed the publishers' "priggish, obtuse, stuffiness".

Roald Dahl's manuscripts and many other treasures from his archive are stored at his former home, now the Roald Dahl Museum and Story Centre in Great Missenden.

• This article was amended on 2 September 2014 to remove an unverifiable figure for book sales.