title: how to edit and update files for different git branches?
body: <p>A repository in my GitHub has two branches: <code>master</code> and <code>solution</code>. First I <code>git clone</code></p>
  <pre><code>git clone &lt;master url&gt;
  </code></pre>
  <p>then I <code>cd</code> to that folder and switch to <code>solution</code> branch</p>
  <pre><code>git checkout solution
  </code></pre>
  <p>I find the contents of files is still the same as in <code>master</code>, e.g. <code>README.md</code>. how can I access <code>solution</code> files?</p>
  <p>then I tried <code>git pull</code> to update the files in <code>solution</code> branch</p>
  <pre><code>git pull origin solution
  </code></pre>
  <p>and it works and now the contents of files are for <code>solution</code>, but when I want to switch back to <code>master</code>, it failed and said I need to merge, because I think some files have different contents in the two branches. How to switch back?</p>
  <p>In general, how to edit and update files in different branches and how to easily switch back and forth?</p>
  <p>Another example:</p>
  <pre><code>          I--J   &lt;-- br1
           /
  ...--G--H   &lt;-- main
           \
            K--L   &lt;-- br2     
                \
                 M--N
                     \
                      P
  </code></pre>
  <p>Is another worktree needed?</p>