You have two options (at least). Performing "work in progress" or cache.
"Work in progress" does just that: it is a commit in a branch that represents work in progress:
 $ git commit -am'WIP (description here)' $ git checkout master 
Later, when you return to your branch, you can continue to work and do:
 $ git checkout mybranch  
When you are done, you can merge your WIP if you want, commit to commits without any evidence that you did partial work:
 $ git rebase -i HEAD~2  
Or you can use the cache:
 $ git add . $ git stash save 'WIP (descriptino here)' $ git checkout master 
Later, when you return to your branch:
 $ git checkout my_branch $ git stash pop 
You will be right where you left off.
Wayne conrad 
source share