Optimize git checkout.

Optimize git checkout, to only refresh the files which have changed between 2 commits.

@devoncarew