It's a bit dangerous to have the tests modify things that are git controlled and then assume the clean up will restore the back up copies. If the test run is aborted -- easily done if a debugger were on the test and the process terminated, but there are other ways -- the git tree will be left as a mess. A cleaner approach would be to copy the git controlled file structure to a tmp directory and work on that instead.