How to move uncommitted changes in a submodule to a new branch
<p>My question is partially duplicate of <a href="https://stackoverflow.com/questions/13687334/moving-uncommitted-changes-to-a-new-branch">Moving uncommitted changes to a new branch</a></p>

<p>However, The trick is, I made changes to few files which belong to a sub-module.</p>

<p>e.g.</p>

<pre><code>My Primary repo: /testing
Sub-module is at: /testing/lib/xyz
</code></pre>

<p>I made changes to quite a few files under <code>/testing/*</code> and <code>/testing/lib/xyz/*</code></p>

<p>Now I can do a <code>git checkout -b new_branch</code> and get my uncommitted changes to a new branch. But this will not get the changes under <code>/testing/lib/xyz/*</code> to the new branch because this path belongs to a sub-module.</p>

<p><strong>Question:</strong> How do I move my uncommitted changes including changes to submodule to a new branch.</p>

<p>The reason being, In my haste, I made quite a few changes to a lot of files in my master branch to fix something. Now the fix is working, however, I do not want to merge these changes to master and I do not want to loose these changes as well. So I thought of moving these changes to a new branch and then continue working on the new branch. But then I faced this sub-module issue.</p>