reset revert

reset  revert

 

git/Documentation/howto/revert-a-faulty-merge.txt at master · git/git https://github.com/git/git/blob/master/Documentation/howto/revert-a-faulty-merge.txt

Git - git-revert Documentation https://git-scm.com/docs/git-revert

 

I have a master branch. We have a branch off of that that some
developers are doing work on. They claim it is ready. We merge it
into the master branch. It breaks something so we revert the merge.
They make changes to the code. they get it to a point where they say
it is ok and we merge again.

When examined, we find that code changes made before the revert are
not in the master branch, but code changes after are in the master
branch.

 

 

 

Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them. This requires your working tree to be clean (no modifications from the HEAD commit).

Note: git revert is used to record some new commits to reverse the effect of some earlier commits (often only a faulty one). If you want to throw away all uncommitted changes in your working directory, you should see git-reset[1], particularly the --hard option. If you want to extract specific files as they were in another commit, you should see git-restore[1], specifically the --source option. Take care with these alternatives as both will discard uncommitted changes in your working directory.

See "Reset, restore and revert" in git[1] for the differences between the three commands.

 

posted @ 2024-07-04 10:49  papering  阅读(2)  评论(0编辑  收藏  举报