Monday, February 6, 2023

How to revert an accidental merge directly to the developer branch not the Jira ticket branch

To revert a merge in TortoiseGit, you can follow these steps:

  1. Right-click on your repository in Windows Explorer and select "TortoiseGit" -> "Show Log".

  2. In the log dialog, select the commit that represents the merge you want to revert.

  3. Right-click on the selected commit and choose "Revert changes from this commit".

  4. A dialog will appear asking you to confirm the revert operation. Click "OK" to proceed.

  5. TortoiseGit will create a new revert commit that undoes the changes from the merge commit.

  6. Push the revert commit to the remote repository to share the changes with other contributors.

  7. Repeat the merge in the correct branch, making sure to select the correct source and destination branches this time.

This should undo the merge you made to the wrong branch and restore the previous state of the code.

No comments:

Post a Comment

LeetCode C++ Cheat Sheet June

🎯 Core Patterns & Representative Questions 1. Arrays & Hashing Two Sum – hash map → O(n) Contains Duplicate , Product of A...