title: Cannot switch branches
body: <p>I'm not at all a git expert and my local git repo is in a bad way.
  I have got two branches master and Deriche. I work now on local branch  Deriche branch and I want to switch master</p>
  
  <pre><code>$ git checkout master 
  error: Your local changes to the following files would be overwritten by checkout:
          modules/ximgproc/src/deriche_filter.cpp Please, commit your changes or stash them before you can switch branches. Aborting
  </code></pre>
  
  <p>then </p>
  
  <pre><code>$ git stash 
  Saved working directory and index state WIP on Deriche: 64025bc Add files via upload 
  HEAD is now at 64025bc Add files via upload
  </code></pre>
  
  <p>then again </p>
  
  <pre><code>$ git checkout master
  error: Your local changes to the following files would be overwritten by checkout:
          modules/ximgproc/src/deriche_filter.cpp
  Please, commit your changes or stash them before you can switch branches.
  Aborting
  </code></pre>
  
  <p>Then git diff results are :</p>
  
  <pre><code>$git diff
  diff --git a/modules/ximgproc/src/deriche_filter.cpp b/modules/ximgproc/src/deriche_filter.cpp
  index 0e45ffb..58d20ca 100644
  --- a/modules/ximgproc/src/deriche_filter.cpp
  +++ b/modules/ximgproc/src/deriche_filter.cpp
  @@ -1,464 +1,464 @@
  -&lt;U+FEFF&gt;#include "precomp.hpp"
  -#include "opencv2/highgui.hpp"
  ......
  </code></pre>
  
  <p>I have tried <a href="https://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull">this</a> without any success.</p>
  
  <p>Thanks you in advance for your help</p>