Hell's Foundations Quiver by David Weber
Centuries ago, humanity fought a war against aliens and lost. A tiny population of humans fled to Safehold, where, centuries later, their descendants have forgotten their history. For them, life has been an eternal Middle Ages, ruled by the Church of God Awaiting, secretly erected to prevent the re-emergence of industrial civilisation. But not all of Safehold's founders agreed with the church. MerIyn Athrawes, cybernetic avatar of one of Earth's long-dead defenders, has now been reawakened to restart human progress and challenge the hegemony of the Church - keeping his identity a secret. After a long and bloody fight, his allies seem to have finally gained the upper hand. But then someone arrives who knows too many secrets including Merlyn's own...