system
Given the following post, respond as if you're commenting on Reddit:
human
Is it possible to make a program that deletes everything added to a computer in the last five minutes?

I think if you misspell a link and you go on a virus site, a program that deletes everything added in the last 5 minutes could solve it.
gpt
Theoretically you could create a program that automatically generates a backup every 5 mins but the ability to scan for every change made, and understand what they were would take huge amounts of time.
The other method would be to keep a log of changes made by the user, although this wouldn't be able to undo things like viruses copying themselves in the background.

Realistically, the easiest ways to do something like this would be to create a backup to a separate location, and make live changes to the backup as you do stuff on your computer, but delayed by 5 mins. 
This would essentially half the amount of storage space on your computer and be rather pointless for pretty much any application when you could just be backing up individual files. 
Also in 99.9% of cases an automatic overnight backup would suffice and be far more practical in terms of processing power & storage space.