Git stash save recovery progress

Source: Internet
Author: User

If the working area and staging area files are changed, save them, ignore these changes, and return to the last submitted state. You can use git stash.

Assume that there is a file T in the project and it is first deleted from git rm t. This file disappears in the working area.

Then execute the GIT stash command and check the working area again.

At this time, call the GIT stash LIST command and you will see:

 
Git stash liststash @ {0}: WIP on Master: 1c47165 change package name

This change was not completely lost, but saved to the stash list. It can be considered that the dispute is put on hold and personal opinions are retained. Although they have obeyed the overall situation, there is still a stash list for personal opinions, which can be taken out at any time in the future.

Use git stash pop,

Removing T # on Branch master # changes not staged for commit: # (use "Git Add/Rm <File>... "To update what will be committed) # (use" Git checkout -- <File>... "To discard changes in working directory) # deleted: T # untracked files: # (use" Git add <File>... "to include in what will be committed?##deploy.tar.bz2 no changes added to commit (use" Git Add "and/or" Git commit-a ") dropped refs/stash @ {0} (bytes)

The result shows that I deleted the T file with GIT RM again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.