Checking out and getting latest ref for revision in git