Clean git repo before checkout

Sometimes git repo become unusable - it contains a lot of
untracked files. Due to this the following checkout fails
and none of commits processed. The solution is to reset the
state and clean all untracked files.

Change-Id: Id230147ac3bfe739ad8be45a7f87da59807fcea4
Merge "Clean git repo before checkout"