Alibabacloud.com offers a wide variety of articles about git revert to previous commit, easily find your git revert to previous commit information here online.
Due to the deletion of a large number of SVN warehouse content, and now suddenly want to restore, but also to keep the log consistency (the recovered deleted files, will be new, no previous history log), so there is this demand.version of Dump repository (version 457 later) " D:\VisualSVN server\svn-repositories\ITV open document " - R 0:457 >d:\itvfwq.dmp restore DMP to Repository --------------------------svnadmin Create D:/ d:\itvFWQ.dmp Delete tem
I wanted to revert to a commit, so I used this, but he cleaned up all my previous commits, can I find the restore in the local repository now?
Reply content:
I wanted to revert to a commit, so I used this, but he cleaned up all my p
on the file level git reset , because the files in the cache are bound to change, and the files in the working directory must be the same.CheckoutCheckout a file and a file path are git reset very similar, except that it changes the working directory rather than the cache. Unlike the checkout command at the commit level, it does not move the head reference, whic
git revert with git resetCommon denominator: The submitted code will be returned to staging areaDifferent points:git revert: Undo an action, use a new commit to mark the old commit invalidation, that is, cancel the operation. Ther
Git Tutorial: reset, revert, gitrevertOne of the reasons for using the version control system is to save the changes made since the beginning of the development, so that you can easily retrieve the previous code or remove incorrect modifications. Even if a developer does not have a version control system, I develop it in one place and find that the direction is w
Http://blog.csdn.net/koffuxu/article/details/6731876git revert is to cancel an operation, the operation before the commit will be retained git reset is to cancel a commit, however, all subsequent modifications will be returned to the temporary storage area. For example, there are three
Git revert uses a new commit to roll back the specified commit. Git reset directly deletes the specified commit.
Git reset moves the head backward, while
Tutorial 3 overwrite submission. 2. Revert
To save time, this tutorial uses existing history as the local database.
Download from here
We will use the revert command to cancel the "Add pull Tutorial" submission.
First enter the Stepup-tutorial/tutorial2 directory. The status of the local side's history is shown in the following figure.
Confirm History with log command
$
and working directory to see what we getgit loggit ls-tree headls-lFigure 3.1List.png is nether in the latest snapshot (see the command checked by git ls-tree) nor in working directory. Now we ' re going to use Commad git revert to rollback the commitment of deletion with the commit ID in red rectangle.git
When using Git, the version is often rolled back if the error is push.There are two ways to roll back a git: revert command
git revert version ID:This command can be used to roll back the changes made to the specified version with a reverse
the previous version of the code)
Rever commit: The record of the operation is saved, the commit record is automatically generated, and the revocation is in effect for the action commit record (for example, I have just submitted a code with a problem, to delete the newly submitted code)
As an example:
If a
feature8.28_buyGifts developed by the small partners of the development Branch, and the main branch could not intervene, and it was confusing.
To verify our own conjecture, we look at Marketitemsinfo.java's submission history.5.png
As we thought, no one has ever moved this file in 7 months.
So a document that has not been moved by people for 7 months, how can the merge of the time of the emergence of this puzzling conflict?
Take a look at all the logs for the current branch.6.png
Seems to ha
two commands, just to keep up with the previous compatibility to make reservations.2. What are the benefits of increasing the stage?There are two main benefits, one is batch, phased submissions, one is to take a snapshot, easy to rewind2.1 submitted in batches to reduce the granularity of commitFor example, you have modified a.py, b.py, c.py, d.py, where a.py and c.py are a function-related modification, and b.py,d.py belongs to another feature-relat
Issue background:recently in the reorganization of the hands of a project, currently the project is divided into PC projects, mobile projects, a third-party interface projects, third-party interface services projects and mobile projectsbecause of the previous planning reasons, the original four projects are managed by two solutionsPC Solutions:#PC解决方案, 2015 total three projects migrated from VSS to git #f:\
Cause: No small new file submitted to git that records the company server IP, account number, password Method: git reset--hard git push origin HEAD--force Other: depending on the –soft–mixed–hard, the working tree and index and head are reset: git reset–mixed: This is the default,
log --since=2.weeks
3) You can also give some search criteria to list the submissions that are eligible. --authorDisplays the submission of the specified author with options and --grep searches for the keywords in the submission description with options. (Note that if you want to have a commit that satisfies both of these options, you must use an --all-match option.) Otherwise, commits that satisfy any one of the conditions will be matched).
Method:
git reset--hard
Git push origin head--force
Other:
According to –soft–mixed–hard, the working tree and the index and head are reset:
Git reset–mixed: This is the default, git reset without any parameters, this way, it's back to a version, only the source, fallback
lists all submissions in the last two weeks:$ git log --since=2.weeksYou can give a variety of time formats, such as specific days ("2008-01-15"), or how long ago ("2 years 1 day 3 minutes ago").You can also give some search criteria to list the submissions that are eligible. --authorDisplays the submission of the specified author with options and --grep searches for the keywords in the submission description with options. (Note that if you want to h
0771a0c107dbf4c96806d22bbc6ef4c58dfe7075 this commit (commit) to the B branch. Under normal circumstances, you can give all the commit ID, or you can just give the previous paragraph, as long as you do not have this section of the submission of repetition, the rest of the git
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.