I added a very large file and had to delete it from the commit. When I did that something happened and it mixed up the commits, brought old commits to my branch. Now i had 5 months commits
So I need to take the commits I made on that branch (3 commits) and take it to a new branch.
(In the image we have dozens of commits, and the last 3, which are mine that I want to keep)
Is there any way I can do this without bringing these old commits? like a git stash?
obs: repo in github
CodePudding user response:
I think git cherry-pick might be a good option if you know which commits you want on the new branch:
git checkout -b my-new-branch <sha of first commit you want>
git cherry-pick <sha of next commit on the new branch>
git cherry-pick <sha of next commit...>
