Git Stashing Move your work in progress to another branch

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

If while working you realize you're on wrong branch and you haven't created any commits yet, you can easily move your work to correct branch using stashing:

git stash
git checkout correct-branch
git stash pop

Remember git stash pop will apply the last stash and delete it from the stash list. To keep the stash in the list and only apply to some branch you can use:

git stash apply


Got any Git Question?