Set up Git with the ignore patterns you choose.
Recent revisions are kept. Restoring one creates a new revision.