Have you ever worked on a bit of code that was really messy and you needed a break from it? You dont want to delete all the progress you made but you cant upload the work on git hub because its either unfinished or problematic. So what can you do? Imagine if there was a way you could temporarily save your work without it affecting the original code, kind of like a draft. Well, you can! Thanks to git stash
You start a stash by using the command git stash
git stash will store whatever progress you made prior to your last commit into a stack, and revert back to the original commit, essentially saving your work as a draft.
You can apply changes to a git stash by using the command git stash {index no.} apply. This will recreate whatever index no. you saved in that git stash. Once you make all the necessary changes you need, you can use git commit to save those changes and push to finalize the code.
You can delete stashes by using git stash drop {index no.}. If you dont specify an index number, drop will delete the first stash saved.
For more information check out the official git documentation on stashing!