Creator of LULs (a script which helps links to point to your instance)

Come say hi here or over at https://twitch.tv/AzzuriteTV :) I like getting to know more people :)

Play games with me: https://steamcommunity.com/id/azzu

  • 0 Posts
  • 4 Comments
Joined 5 months ago
cake
Cake day: May 10th, 2026

help-circle



  • git revert does not go back to that commit, it takes the changes that are in that commit and tries to create a new set of changes that are the opposite, i.e. undo the changes of that specific commit.

    You could have known that by reading the official documentation of that command, which says essentially the same thing: “Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them.” https://git-scm.com/docs/git-revert

    Now, if you look at the documentation of git reset, it says “changes which commit HEAD points to. This makes it possible to undo various Git operations, for example commit, merge, rebase, and pull.” i.e. this does go back to that commit.

    Since revert tries to create new changes, it’s of course possible to get conflicts, since you probably changed a bunch since then. If you wanted git revert to work in this case, instead of reverting the commit “you want to go to”, you could have reverted all commits since then instead.

    So in English, what you did was “try to remove the specific changes within the commit I’m giving you”(git revert) instead of “go back to the commit I’m giving you” (git reset). Next time, try not to get mad and just do a web search, all of those results mention git reset or reverting all commits since then.