Typically, here’s how workflows in Git work: Changes are made in the local repository and tested end-to-end before being committed to the master branch. However, the work does not always flow so linearly. While working on a project, you may need to switch to another branch before you can complete changes in the current branch. In this case, it is better not to commit because the uncommitted modifications would be added, creating confusion. The solution is to go through Git Stash: this command save current changesremainingAt your disposal.
This includes all changes that have not yet been committed. If you then want to go back to these files, just grab them from the Git Stash and finish editing. Thus, the changes made are not lost, your work is preserved and you can even continue to work on other points flexibly. Without Git Stash, you are guaranteed to receive an error message during a Git Checkout, or even to lose important modifications.