What you are doing is correct, but you might want to add disambiguating -- just in case you have a directory name, the same as a branch name, i.e.
git checkout -- whole_folder
git will only update timestamps on files that actually need to be changed, so if your dependency tool uses mtimes correctly, the minimum safe number of files should be rebuilt. If you see other behavior, this will be a mistake.
Mark longair
source share