Like Khaled said, you could just issue drop database, drop user, etc. Statements to clean up all changes made to the initial Database.
For the Database Configuration you might be interested in just putting the files under version control (git,svn &co).
For Subversion you could do something like this:
Install Subversion
$ sudo apt-get install subversion
Setup the Repository
$ mkdir ~/pgsqlsvn
$ svnadmin create
Stop the Service
$ sudo service postgresql stop
Initially fill the repository:
$ cd /etc/postgresql
$ sudo svn co file:///home/you/pgsqlsvn ./
$ sudo svn add *
$ sudo svn commit
Reverting the Configuration Afterwards
Everytime you need to reset to the initital Database configuration you can just
$ sudo svn update /etc/postgresql -r 1