There is a free windows program called Steadier State which can do what you are asking. You didn't specify any Windows version. Steadier State lists Windows 7 Enterprise or Windows 7 Ultimate as requirements.
As for one which supports WindowsXP through Windows10, the Home Edition of RollBack RxPC is freeware and should do the trick.