properly reset cwd after finding version of git resource