In the best traditions of chaos theory the storm which engulfed the coalition's forestry sell-off began last summer with little more than the fluttering of a butterfly's wings when new ministers warned the Forestry Commission that modest in-year savings would have to be made in its current budget.

Officials who routinely buy and sell forestry land are used to making sales in hard times. They set about finding some, only to be overtaken by far bigger demands from Defra HQ in Whitehall. Caroline Spelman, the new secretary of state, was keen to impress David Cameron and George Osborne by her zeal for the kind of cuts, deep and urgent, which the chancellor's tight fiscal strategy now demanded.

But by declaring her willingness to sacrifice 30% of Defra's already modest £2.8bn budget she made a classic Whitehall error. She alienated many of her own officials (she had already declared the department "flabby") without winning admiration or gratitude in Downing St. Fatefully, a 15% sale of the Forestry Commission's assets - theoretically worth £100m to the government - was suddenly on the table, as well as a new rationale in the chance to scale down or abolish another quango, the 90-year-old commission.

There was worse to follow for the forestry industry and for the millions of voters who cherish Britain's diverse woodlands. When Francis Maude's Public Bodies Bill, the much-criticised measure to cull quangos, surfaced in October, clauses 17 and 18 gave Spelman sweeping new powers to dispose of the entire Forestry Commission estate - 1,500 woods and 258,000 hectares, worth an estimated £250m more, though past sales have often proved to be below market value.

Far from launching such a radical plan via a green paper, consultation, a white paper and a bill, Spelman was trying to do it backwards without preparing the ground as Iain Duncan Smith's welfare reforms have sought to do. The forestry consultation paper and accompanying impact assessment (it revealed that the associated costs would outweigh the income from the sale) only appeared on January 27 - after nearly four months of agitation.

Old forestry hands were quick to recognise what was afoot. In 1981 the Thatcher government had amended the 1967 Forestry Act to facilitate limited privatisations and were thwarted in their wider ambitions. In Scotland it became a major symbol of hostility to Thatcherism and predatory capitalism.

In England the Royal Forest of Dean won a special exemption in 1981. Last October veterans of that battle sprung into action with a Hands off our Forest (HOOF) campaign, helped by the coincidence that Labour's leader in the Lords, ex-cabinet minister, Jan Royall, is herself a local "forester". The warnings of history went unheeded however. As a result of her enthusiastic wielding of the axe, Spelman had few sympathetic officials within her department to warn her that a fresh attempt at a forestry sell-off would be an emotive issue.

Establishment bodies like the National Trust and Woodland Trust were slow off the mark. But radical groups, most conspicuously the 38 Degrees website, started petitions which are now approaching the 1 million signature mark. The campaigners made effective use of social media, such as Facebook and Twitter, and gathered a wide range of supporters who included some unusual bedfellows, ranging from Tory MPs to the Socialist Worker's Party. Jubilant posters on the campaign's Facebook page toasted policy re-think as a result of"people power" that had mobilised such an unlikely army.

It all helped tilt the government towards what the wits are calling this week's Yew-turn. By the time Maude's bill got its second reading in the Lords, Royall used her opening speech to denounce its sweeping powers, especially in respect of the nation's forests.

She was backed up by Lord David Clark, former junior forestry official turned cabinet minister and (later) the commission's chairman. And in Labour's new Commons spokesman, Mary Creagh, Spelman had an ambitious and aggressive opposition shadow, keen to build her own front bench reputation.

Things could only get worse and ministers started offering different justifications for their action. In November forestry minister, Jim Paice, a tactlessly plain-spoken farmer from East Anglia (not too many forests there), told a Commons committee that the government envisaged "a very substantial disposal of the public forest estate which could go to the extent of all of it".

What had started off as a money-saver was now presented as a Big Society initiative, one which would allow communities and charities to buy and cherish their woodlands, by "breaking up the monolithic provision of public services into a plurality of providers" and taking the government out of the equation. "We were so enamoured of this idea across the board. We love that kind of thinking ... it blinded us to the political implications," admits one No 10 insider. Ministers also sought to justify the sell-off on the grounds that the Forestry Commission was both the major UK producer of timber and the industry's regulator: a conflict of interest. The justifications had a ram-shackled ring to them, made up after the decision to sell.

Spelman promised to do better. But she and Paice were making enemies, arousing the suspicion that her officials might be gently hanging them out to dry. Her cuts to the flood defence budget alarmed local councils and spooked the insurance industry. Though a former sugar beet negotiator for the NFU, she even managed to antagonise a group which should be loyal backers - farmers - when she suggested in January that direct subsidy payments should be abolished. For hard-pressed farmers for whom subsidies make the difference between profit and loss, that was shocking. She was forced to backtrack swiftly, insisting the payments would be kept. Even so, Spelman got a lacklustre reception at the NFU conference this week.

Her failure to build up support for her policies among key stakeholders also played a part in her downfall, Defra watchers suggest. Fiona Reynolds, director general of the National Trust, admitted to being "very surprised" to have had no approach from Defra before the forests sell-off was announced, despite being a prime candidate to take on stewardship of heritage woodlands.

"I haven't seen enough of her to have an impression, and that is very telling," said Bill Bryson, writer-president of the Campaign to Protect Rural England. "We had very good relationships with her predecessors."

"She has not been very visible," adds a rural specialist. "They [Defra ministers] are not listening as they think they know it all already." Another said the steep Defra budget cuts showed "how badly government can get it wrong if it doesn't talk to the people who know what's going on".

This week Cameron decided, as all prime ministers eventually realise they must, that it was time to cut his losses. So much political grief for so little gain. In the end it was a no-brainer.