title: What is the difference between git-stash and git-checkout?
body: <p>I try to go from one local branch to another one. Git tells me that I cannot do it because my <code>local changes to the following files would be overwritten by checkout</code>.</p>
  
  <p>Then I get a "recommendation" <code>Please, commit your changes or stash them before you can switch branches</code>.</p>
  
  <p>I know that I do not need the changes to the mentioned file. It is OK to overwrite them. So, I try to <code>stash</code>. I execute <code>git stash file_name</code>. As a result I get:</p>
  
  <pre><code>Usage: git stash list [&lt;options&gt;]
     or: git stash show [&lt;stash&gt;]
     or: git stash drop [-q|--quiet] [&lt;stash&gt;]
     or: git stash ( pop | apply ) [--index] [-q|--quiet] [&lt;stash&gt;]
     or: git stash branch &lt;branchname&gt; [&lt;stash&gt;]
     or: git stash [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
                 [-u|--include-untracked] [-a|--all] [&lt;message&gt;]]
     or: git stash clear
  </code></pre>
  
  <p>OK. It does not work. Then I try <code>git checkout file_name</code>. No complains from git. Then I can switch from one branch to another one. So, it seems that I got what I needed (go to the second branch without saving changes to the first branch).</p>
  
  <p>However, I would like to ask why <code>stash</code> did not work, and how the final result would be different in case it had worked?</p>