How to revert a particular commit using TortoiseGit?

0

Issue

I have a repo named messaging parent.
Initially the version of this repo was 1.1.0 . Then it was upgraded to 1.2.0 with some changes. Now we have pushed some more changes on top of this version. For some reason the commit where the version was changed from 1.1.0 to 1.2.0 with some changes has to be reverted. Is it possible to revert that commit but still keep our latest changes which we pushed on top of that? There are no conflicting files in both the commits

Solution

yes, you can: TortoiseGit -> Show Log, then select this commit, press right button and select from context menu: Revert Change by this commit.

enter image description here

New commit will be created, which revert this commit, all other commits are staying untouched.

From atlassian git revert:

The git revert command undoes a committed snapshot. But, instead of
removing the commit from the project history, it figures out how to
undo the changes introduced by the commit and appends a new commit
with the resulting content. This prevents Git from losing history,
which is important for the integrity of your revision history and for
reliable collaboration.

Answered By – Alexan

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More