would it work if you did the git checkout from the directory the file lives in?
exec (' ... ', {cwd: <dir of file to be reverted>}, function(...) {...})