git cherry-pick should be your answer here.

Apply the change introduced by an existing commit.

Do not forget to read bdonlan's answer about the consequence of cherry-picking in this post:
"Pull all commits from a branch, push specified commits to another", where:

A-----B------C
 \
  \
   D

becomes:

A-----B------C
 \
  \
   D-----C'

The problem with this commit is that git considers commits to include all history before them

Where C' has a different SHA-1 ID.
Likewise, cherry picking a commit from one branch to another basically involves generating a patch, then applying it, thus losing history that way as well.

This changing of commit IDs breaks git's merging functionality among other things (though if used sparingly there are heuristics that will paper over this).
More importantly though, it ignores functional dependencies - if C actually used a function defined in B, you'll never know.

Answer from VonC on Stack Overflow
🌐
Better Stack
betterstack.com › community › questions › how-to-merge-specific-commit
How to Merge a Specific Commit in Git | Better Stack Community
August 12, 2024 - Use the cherry-pick command to apply the changes from the specific commit onto the current branch. ... Replace <commit-hash> with the hash of the commit you want to apply. If the commit being cherry-picked causes conflicts with the current branch, ...
Discussions

git - Merge up to a specific commit - Stack Overflow
I created a new branch named newbranch from the master branch in git. Now I have done some work and want to merge newbranch to master; however, I have made some extra changes to newbranch and I want to merge newbranch up to the fourth-from-the-last commit to master. More on stackoverflow.com
🌐 stackoverflow.com
How to merge branches to a specific commit
git switch main; git merge 1.0.1 —ff-only; More on reddit.com
🌐 r/git
5
6
January 14, 2021
git - How merge branch with specific commit - Stack Overflow
So now I want to remove the last commit on the master branch and merge my new commits with the master branch before that specific commit. ... Use git rest hard and push the changes, so that the commit will be removed and to commit specific commit , use git cherry-pick More on stackoverflow.com
🌐 stackoverflow.com
git - How to merge specific commit id from different branch in same repo - Stack Overflow
I had two branches master & trunk. I have created one more branch in local using git checkout -b new_branch origin/master to take the master code in that branch. I have added committed some c... More on stackoverflow.com
🌐 stackoverflow.com
🌐
DEV Community
dev.to › iamafro › how-to-merge-a-specific-commit-into-another-branch--oak
How to merge a specific commit into another branch - DEV Community
February 15, 2018 - First you checkout the branch you want to merge the commits into ... What this does is, "It applies the change introduced by the commit at the tip of the working branch and creates a new commit with this change". The issue I had with that was, I had made a couple of commits and I needed all those commits in the master branch. That's when I found it. What did I find? you may be asking. Gitlens is what I found.
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-merge-commits-in-git
How to Merge Commits in Git? - GeeksforGeeks
July 23, 2025 - ... This method allows you to merge all changes from a branch but combine them into a single commit. ... git checkout main git merge --squash feature git commit -m "Merged feature branch as a single commit"
🌐
Delft Stack
delftstack.com › home › howto › git › git merge specific commit
How to Merge a Specific Commit in Git | Delft Stack
March 11, 2025 - This can be particularly useful ... most straightforward methods to merge a specific commit in Git is by using the git cherry-pick command....
Find elsewhere
🌐
W3docs
w3docs.com › git
How to Merge a Specific Commit in Git | W3Docs
Below, you will find out how to do it by using git cherry-pick. Now let’s follow these steps to get the job done appropriately: First of all, you need to download all the changes from the remote by running the git fetch command:
🌐
Better Programming
betterprogramming.pub › git-cherry-pick-selecting-specific-commits-to-merge-f1bf245e052a
Git Cherry Pick - Select specific commits to merge | by Carlos Fernando Arboleda Garcés | Better Programming
December 13, 2023 - Fortunately, my teammates had already solved this before and had an ace up their sleeve: git cherry-pick. This Git command makes it possible to apply existing commits to another branch by picking the specific commits that you need.
🌐
Reddit
reddit.com › r/git › how to merge branches to a specific commit
r/git on Reddit: How to merge branches to a specific commit
January 14, 2021 -

I have two branches, main and develop. Lets say that this is my current commit history:

A - B - C - D (main) (tag 1.0.0) - E - F - G (tag 1.0.1) - H (develop)

I want to bring main to G (tag 1.0.1) so that it is one commit behind develop. Note that, I want all commits between main and G to also be included. Would I use cherry-pick or is there a better way?

🌐
Codemia
codemia.io › home › knowledge hub › how to merge a specific commit in git
How to merge a specific commit in Git | Codemia
January 2, 2025 - Identify the Commit Hash: Use the git log command or any Git UI tool to find the commit hash of the commit you want to merge. Checkout to the Target Branch: Switch to the branch where you want to apply the commit.
🌐
Linux Hint
linuxhint.com › merge-specific-commit-git
How to Merge a Specific Commit in Git – Linux Hint
To merge a Git-specific commit, open the Git branch of which you want to merge the commit and note the commit id. Afterward, move to the Git branch in which you are needed to merge the specific Git commit and use the “git cherry-pick commit-id” command for merging the commit.
🌐
W3Guy
w3guy.com › git-merge-commit-from-another-branch
Git: Merge a Specific Commit From One Branch to Another
May 28, 2016 - Scenarios like this is where git cherry-pick comes in handy. A cherry-pick is like a rebase for a single commit. It takes the patch that was introduced in a commit and tries to reapply it on the branch you’re currently on.
🌐
Git
git-scm.com › docs › git-merge
Git - git-merge Documentation
Commits, usually other branch heads, to merge into our branch. Specifying more than one commit will create a merge with more than two parents (affectionately called an Octopus merge). If no commit is given from the command line, merge the remote-tracking branches that the current branch is configured to use as its upstream.
🌐
Medianeth
medianeth.dev › blog › how-to-merge-only-specific-changes-from-git-branch
How to Merge Only Specific Changes from a Git Branch: Avoiding Unwanted Commits
The solution is Git Cherry-Pick. Think of cherry-pick as a surgical tool. Instead of merging a whole branch history, it allows you to copy-paste specific commits onto your clean branch.
🌐
Medium
medium.com › @mgopal.0001 › merging-specific-commits-after-a-certain-point-in-git-f59e704027df
Merging Specific Commits After a Certain Point in Git | by Madan gopal | Medium
October 18, 2024 - In such cases, a full merge would bring in unrelated changes, which could clutter your work. Git offers two ways to pull only the commits you need: cherry-picking and rebasing with the --onto option.
🌐
Git
git-scm.com › book › en › v2 › Git-Branching-Basic-Branching-and-Merging
Git - Basic Branching and Merging
To phrase that another way, when you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together — this is called a “fast-forward.” · Your change is now in the snapshot of the commit pointed to by the master branch, and you can deploy the fix.