If I work on branch A and suddenly need to work on branch B before being ready with a commit on branch A, I stash my changes on A, checkout B, do my work there, then checkou
You can use the following commands:
To save your uncommitted changes
git stash
To list your saved stashes
git stash list
To apply/get back the uncommited changes where x is 0,1,2...
git stash apply stash@{x}
Note:
To apply a stash and remove it from the stash list
git stash pop stash@{x}
To apply a stash and keep it in the stash list
git stash apply stash@{x}