Imagine a world where pandas are no longer endangered and an area of the Pacific twice the size of Texas has been turned into a marine protected area. Picture a Scotland where protected beavers roam, and an England where more large blue butterflies dance than at any time since the 1930s. Or dream of a Wales where the majestic crane breeds for the first time in 400 years.

This isn’t a fantasy. This is the planet in 2016. Stuck inside, plugged into the miserable echo chamber of social media, we can miss the rays of sunshine. The air is still free. Sunsets remain beautiful. Trees continue to soothe our restless lives.

We have to be careful not to be Panglossian. We know that, as a species, our relationship with the world isn’t so wonderful. This was also the year in which it was revealed that the number of wild animals on Earth has halved in the past 40 years. Following almost every piece of happy environmental news is a “but”. For instance, the giant panda was taken off the most-endangered list after a 17% rise in its wild population to 1,864 over a decade. But the International Union for Conservation of Nature also announced that poaching is driving the eastern gorilla – now listed as critically endangered – towards extinction.

One of the most endangered things in our dysfunctional relationship with the Earth is hope. We may be wreaking more destruction on our planet than ever before, but we are also proving more proactive, scientific and enlightened in the ways we live alongside other forms of life. So there is hope.

Facebook Twitter Pinterest Giant panda cubs in Chengdu, China. Photograph: Imaginechina/Rex/Shutterstock

Collectively, 182 nations in the Convention on the International Trade in Endangered Species (Cites) this year agreed a total ban on trading pangolins, gave the African grey parrot the highest level of protection and ordered the closure of domestic ivory markets.

Enjoying the sunshine in Britain were record numbers of the large blue butterfly, an insect that became extinct in 1979 but was revived via caterpillars brought from Sweden in a camper van. It was also a record summer for the rare shrill carder bee, found in two new locations in south Wales, and numerous birds. There were just 11 male bitterns in Britain in 1997, but this summer 47 males made their booming call in Somerset alone. Common cranes were also extinct in Britain for four centuries, but a record-breaking 48 pairs bred this year. In Scotland, beavers have become the first mammal to be officially reintroduced and protected as a native animal after 400 years of extinction. In England, beavers are back on the river Otter, and otters on the river Trent.

Left alone, nature has spectacular powers of recovery, but none of these revivals has happened by chance. Other rare birds, from chough to stone curlew to cirl bunting, have done better than ever this year, because farmers collaborated with wildlife charities from the RSPB to the National Trust. This isn’t staid old “conservation”: it is restoration, and it has made 2016 a thrilling year. Dozens of exciting new spaces for nature have been created: wetlands at Fingringhoe Wick, Essex; the conversion of a fish farm near Driffield, Yorkshire, into Skerne Wetlands nature reserve; RAF Woodhall Spa Airfield (former home of the Dambusters squadron) has become a new nature reserve. In October, a scrapyard was saved for the nation: Shropshire Wildlife Trust is removing 100,000 used tyres from the site, which will be restored (thanks to the last of our EU wildlife funds) to create one of the country’s largest lowland peat bogs.

Most unexpectedly, perhaps, we are learning to live with urban wildlife. More than 13,000 sq m of reedbed have been created at Woodberry Wetlands reserve, London, where more than 100 moth and 101 bird species have been counted in its first year. Milton Keynes this year opened its Floodplain Forest reserve: as the name suggests, such rewilded spaces also provide practical flood defence for urban areas.

Facebook Twitter Pinterest Record numbers of the large blue butterfly enjoyed the sunshine in Britain this summer. Photograph: Alamy

On British beaches, the number of plastic bags found this year has almost halved, thanks to England’s new 5p levy, which cut the number taken from big retailers by 85%. Plastic microbeads, so harmful to sea creatures, will be banned from next year. Below the waves, the government created 23 new marine conservation zones around England, while the State of Nature report revealed that better fishing practices have helped 62% of marine species increase since 1970. Most of these were fish, and some from a perilously low number: it helps grey seals thrive, too.

We are realising that the best cure for doom and gloom is to do something: people have dedicated 1.5 million voluntary hours over the past year to helping British wildlife, from counting bats to joining Red Squirrels United, a new mission to save red squirrels. We can even do it ourselves, much like Adrian Cooper, who used Facebook to establish a community nature reserve in Felixstowe.

So raise a glass of Somerset cider – sweeter after the golden harvest of 2016 than it has been for a decade – to toast hope, and action. Next year can be better.

• Where did it all go right? For a more positive view of the world in 2017, follow the Guardian’s Half Full online series, with reports on innovative ideas and solutions to the challenges of the day. Wishing you all a happier new year.