This appears to be an inch-worm, the larval caterpillar stage of a moth (order Lepidoptera) in the Geometridae family. According to Bugguide (my emphasis):
Larva - generally have only two pairs of prolegs (at the hind end) rather than the usual five pairs in most lepidoptera; the lack of prolegs in the middle of the body necessitates the peculiar method of locomotion, drawing the hind end up to the thoracic legs to form a loop, and then extending the body forward.
The systematics/taxonomy of this group is unclear, debated, and in flux. However, the majority of stick-like larval forms I could find seemed to be associated with the current Ennominae subfamily, which is also the largest of subfamilies in this family of moths.
Müller et al. (2019) just published the 6th volume of "The Geometrid Moths of Europe", which might be a good starting point for IDing this specimen more precisely. A book description from NHBS:
More than half of the European Ennominae, a total of 181 species, plus 21 new species for the European fauna are covered in two hardback parts (with text and plates in separate volumes), including difficult genera...
You could also keep an eye on or alternatively submit an ID request over at Wildlife Insight's Illustrated Guide to British Caterpillars.