[git] IDEA-99849 Force checkout as new branch reports "branch already exists"

Mark repository as successful if force checkout succeedes.
Add a test.
(cherry picked from commit 3cef45370d5d45f38157eed7868c7e7c0fed2c3d)
[reviewed by irengrig]