Why do I get conflicts when I do git revert?

That’s actually not what revert does. Revert doesn’t “take you back to” that commit and pretend that subsequent commits didn’t happen. It applies a logical negation of a single commit – and that commit alone – leaving subsequent commits in place. Let’s say you have some initial commit of some file – let’s call it … Read more

What’s the difference between Git Revert, Checkout and Reset?

These three commands have entirely different purposes. They are not even remotely similar. git revert This command creates a new commit that undoes the changes from a previous commit. This command adds new history to the project (it doesn’t modify existing history). git checkout This command checks-out content from the repository and puts it in … Read more

How can I revert multiple Git commits?

Expanding what I wrote in a comment The general rule is that you should not rewrite (change) history that you have published, because somebody might have based their work on it. If you rewrite (change) history, you would make problems with merging their changes and with updating for them. So the solution is to create … Read more

Re-doing a reverted merge in Git

You have to “revert the revert”. Depending on you how did the original revert, it may not be as easy as it sounds. Look at the official document on this topic. —o—o—o—M—x—x—W—x—Y / —A—B——————-C—D to allow: —o—o—o—M—x—x——-x——-* / / —A—B——————-C—D But does it all work? Sure it does. You can revert a merge, and from … Read more

How to revert multiple git commits?

Expanding what I wrote in a comment The general rule is that you should not rewrite (change) history that you have published, because somebody might have based their work on it. If you rewrite (change) history, you would make problems with merging their changes and with updating for them. So the solution is to create … Read more