Http://blog.csdn.net/qinjienj/article/details/7475890
Developers often encounter this situation: it takes a few days to create a new function, and has changed more than a dozen files. Suddenly, a bug needs to be solved urgently, and then a build test group is given. Before the advent of git, manual backup was basically required, which was time-consuming and error-prone.
In short, the GIT stash command is used to help developers temporarily shelve the changes they have made, roll back to the status before the changes, and perform other necessary operations (such as publishing, solving a bug, or branch, and so on. You can reload the changes that were put on hold later. Is it cool?
First, use git add to add all the changes to the staging area.
Git add.
Use git stash to put these changes on hold.
Git stash
At this point, the current work platform will reply to the change. What should I do? 10 thousand words are omitted here.
Need to retrieve the changes that were previously shelved and continue the previous work?
Git stash apply.
You can also use git stash list to view all the shelved versions (it may have been shelved many times, so it is better not to do this, it is easy to confuse)
When a stack is shelved, for example, if you want to retrieve the 2nd stacks, you can use git stash apply stash @ {1}
If you want to retrieve 1st, you can use git stash pop
If you want to delete a stash, git stash drop <ID>
Delete all stash and git stash clear