How does System Restore help to get rid of virus?
It's not as simple as it being able to wipe a machine clear of viruses. I'll explain...
Imagine you get a virus, it's going to infect and attack your system in a fast and wide spread fashion. We're talking your entire system infected in a matter of days at the most. Anything in the Operating System (OS) is compromised.
Windows System Restore (WSR) is in the operating system, so it's going to be targeted by the virus; and because most viruses (rightfully) assume it's going to be a go-to for most people, it's going to target that with a higher priority.
Because of this, I don't recommend using WSR as a method for removing a virus. It's too unreliable. Hypothetically it would revert your system to before you had the virus but it's more often then not too compromised to do so.
IF you aren't backing up your data, re-formatting the machine is the best option. If you can, back up your data with a disk imager like Macrium Reflect Free, or a snapshot tool like Comodo Time Machine or RollBack Rx. Those will be far more reliable for restoring your machine, and all three offer a freeware version.