You can use git checkout to switch to the other branch and then use git cherry-pick to apply the changes. Here are the steps:

  1. Commit your changes in the current branch if you haven’t done so already. You can do this with git commit -m "Your commit message".
  2. Note the commit hash of the commit you want to apply to the other branch. You can see the commit hash with git log.
  3. Switch to the other branch with git checkout <other-branch>.
  4. Apply the commit with git cherry-pick <commit-hash>.

Here’s what the commands might look like:

git commit -m "Your commit message"
git log # Note the commit hash of your commit
git checkout other-branch
git cherry-pick commit-hash

Replace other-branch with the name of the other branch and commit-hash with the commit hash of your commit.

Please note that if there are conflicts between the changes in your commit and the changes in the other branch, you will need to resolve these conflicts manually.