What is "any previous state"? And for what OSes?
\r
In Linux, the integrity of the files installed from packages, know package managers. For example, in gentoo you can verify the integrity of package k3b like this:
\r
\r
vvdm ~ # equery check k3b
* Checking app-cdr/k3b-2.0.1 ...
415 out of 415 files passed
\r
\r
Similarly, it can be done, for example, distributions based on rpm:
www.rpm.org/max-rpm/ch-rpm-verify.html\r
In debianday this: "debsums -ca "
\r
With the configuration files more difficult. They are designed to that would have to change. There is only one reasonable approach: making periodic backups. Once a week to archive the /etc/ as a rule sufficient.
\r
Theoretically, you could write a daemon that would monitor the status /etc/ and made notes about changes of certain configuration files, but I haven't heard that someone used this approach. Just as unnecessary.
\r
Sometimes there are tips to use some version control system for /etc/ (and in recent years it has become much easier with the advent of git, mercurial, and other DVCS), but in my experience, such a need never arose.
\r
P. S. Well, on Windows monitoring file integrity monitor anti-virus software is, in essence, their main job.