Rolling back a git tree, fully or partially (single file) how to?
- by Tzury Bar Yochay
On a given server, I have a set of daemons each of which has its own configuration file.
I would like to use git to manage the configuration files editing during time and always have the option to rollback to the "factory defaults" in regards to all files or a specific one.
For instance, given the following structure:
$ ls -l
total 0
-rw-r--r-- 1 tzury tzury 0 2011-01-05 06:36 bar.conf
-rw-r--r-- 1 tzury tzury 0 2011-01-05 06:36 baz.conf
-rw-r--r-- 1 tzury tzury 0 2011-01-05 06:36 foo.conf
Assuming all those .conf files are stored in a git repository, I want to be able to restore all files into their original shape (that would be the first git commit). Yet, I would also like to be able to rollback a specific file to the factory defaults, while others remain up to date.