In git, how to rollback certain commits in a branch, but not roll them back in the parent branch even after merging?

Hope this will be a simple question. I am relatively new to git, and there are some things that I still do not ... git.

Hypothetical situation:

Assume that the development branch contains two commits: c1 and c2.

After c2, a release branch is created, so the release branch also contains c1 and c2.

He then decided that c1 should be postponed until a later release.

What is the recommended way to remove c1 from the release branch without also removing c1 from the development branch when the release branch is merged back into development?

+4
source share
1 answer

, , :

  • c1 . (git revert <c1-commit-id>)
  • , commit, 1. (git revert <c1-revert-commit-id>)

Git revert: - git revert <commit-id>

+4

Source: https://habr.com/ru/post/1680598/


All Articles