Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reapply a commit that was undone by conflict?

I have this commit that was undone by someone who doesn't know how to deal with conflicts. Is there an easy way to try auto merging the commit back in? I tried using "merge to master" but it just says up to date. I am using tortoisegit.

like image 269
Will Avatar asked Jul 24 '11 14:07

Will


People also ask

How do you apply a commit again in git?

Sometimes work can get lost when there are mishaps using Git. Changes can be reversed by accident by reverts of merge commits for example. The quickest way to fix such issues of lost changes is to use git cherry-pick which allows you to apply the changes introduced by existing commits.

How do I change back to a commit?

Go back to the selected commit on your local environmentUse git checkout & the ID (in the same way you would checkout a branch) to go back: $ git checkout <commit-id> . Don't forget the final ' .


1 Answers

That's what git cherry-pick is for. It lets you apply changes by using already existing commits.

The basic syntax is:

git cherry-pick <commit> ...  
like image 194
svick Avatar answered Sep 30 '22 07:09

svick