diff --git a/dvc/scm/git/__init__.py b/dvc/scm/git/__init__.py
--- a/dvc/scm/git/__init__.py
+++ b/dvc/scm/git/__init__.py
@@ -216,7 +216,11 @@ def list_tags(self):
         return [t.name for t in self.repo.tags]
 
     def _install_hook(self, name, cmd):
-        command = '[ -z "$(git ls-files .dvc)" ] || exec dvc {}'.format(cmd)
+        command = (
+            '[ "$3" == "0" ]'
+            ' || [ -z "$(git ls-files .dvc)" ]'
+            " || exec dvc {}".format(cmd)
+        )
 
         hook = os.path.join(self.root_dir, self.GIT_DIR, "hooks", name)
 

@gthb Thanks for reporting this! Looks like we are not using post-checkout parameters that are being passed to us by git and are indicating if we are checking out a specific file or a branch/tag/etc. https://git-scm.com/docs/githooks#_post_checkout We need to adjust our hook accordingly.
@gthb Looks like the third parameter is just what we need. You could try modifying your git hook by hand to see if that will do the job for you. If it does, please let us know, and maybe consider submitting a PR, we really appreciate your contributions :slightly_smiling_face: If it doesn't work, please ping us as well.
diff --git a/tests/func/test_install.py b/tests/func/test_install.py
--- a/tests/func/test_install.py
+++ b/tests/func/test_install.py
@@ -39,7 +39,9 @@ def test_should_append_hooks_if_file_already_exists(self, git, dvc_repo):
         expected_script = (
             "#!/bin/sh\n"
             "echo hello\n"
-            '[ -z "$(git ls-files .dvc)" ] || exec dvc checkout\n'
+            '[ "$3" == "0" ]'
+            ' || [ -z "$(git ls-files .dvc)" ]'
+            " || exec dvc checkout\n"
         )
 
         with open(self._hook("post-checkout"), "r") as fobj:
@@ -51,7 +53,9 @@ def test_should_be_idempotent(self, git, dvc_repo):
 
         expected_script = (
             "#!/bin/sh\n"
-            '[ -z "$(git ls-files .dvc)" ] || exec dvc checkout\n'
+            '[ "$3" == "0" ]'
+            ' || [ -z "$(git ls-files .dvc)" ]'
+            " || exec dvc checkout\n"
         )
 
         with open(self._hook("post-checkout"), "r") as fobj:

git checkout some-file causes dvc to try to remove a dvc-managed file
When I `git checkout some-file` to clean away my local changes to that file, the dvc hook butts in and says:

> ERROR: unexpected error - unable to remove 'data/qix/1a285cea-7b71-4492-9b4d-87092bfb9869.json.gz' without a confirmation from the user. Use '-f' to force.

But I did not request removal of that file, and I don't understand why DVC is trying to do that.

Note that I'm _not_ switching to a different branch/tag/commit, because I specified a path to `git checkout`. So I'm only modifying files in my working tree. I don't think that should trigger DVC to [try to] remove files.

Platform: macOS, Python 3.7.4 virtualenv installed using `pyenv`, and:
```bash
$ dvc --version
0.54.1+5e4d26
```

tests/func/test_install.py::TestInstall::test_should_append_hooks_if_file_already_exists tests/func/test_install.py::TestInstall::test_should_be_idempotent
tests/func/test_install.py::TestInstall::test_should_create_hooks tests/func/test_install.py::TestInstall::test_should_post_checkout_hook_checkout tests/func/test_install.py::TestInstall::test_should_pre_push_hook_push