Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
git switch development
git switch -c revert-changes
git revert <commitId> (or range with <commitIdBegin>..<commitIdEnd>
When you learn git, you will realize it's often hard to f-up (lose changes). Maybe go through https://learngitbranching.js.org
I would create a new branch on the tip of your feature branch, drop unnecessary commits first, and then rebase it on the latest master.
It's similar to the IntrusionCM's approach, but you will be able to solve conflicts more gradually.
1. Switch to a new branch on the tip of your old branch:
"git switch -c <new-branch> <old-branch>"
2. Rebase new branch to the branching point of your old branch and drop commits you don't need:
"git rebase -i <old-branch-start>"
3. Rebase to latest master:
"git rebase <master>"