'How to rebase and choose which changes I want in Git?

Git newbie here, thanks in advance for the assistance and patience.

I have a branch with tag A, which I checked out, edited, and published as branch B. I have since made multiple commits to branch B. I've also realized that I want to keep some of the changes I made in branch B, but not all of them. since I've made a number of commits, I'm not sure specifically which commits to revert. Given that, I'd like a way to start with the original tag A code and have VS Code show me the changes I've made in B so I can click on each section of code and either keep or not keep what I need.

Is something like this possible? I have done rebasing before but am by no means an expert.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source