Stash
git stash
git stash push
- like an array method this will create a Box and put all your changes inside of it and shove that box in the corner of the room and give you a clean working tree.
- The box is now portable and you can switch to another branch and open the box there and take out all of the changes.
git stash pop
- This opens the box and applies all those stashed changes to the current working tree.
- This is very useful for the situations where maybe you made a bunch of changes and you forgot to make a new branch and you're still on
master
/main
and you want to move all those changes to the actual feature branch.
Saving and moving changes
git stash push
git stash pop