I created a new branch new_feature
and started working on it. I did 4 commits so far and pushed all of them to remote. But for some official reason I need to remove all the commits from both local and remote but I need to keep the changes locally and then commit everything again in one single commit. So the steps I need to do are
- Remove commits from local branch
new_feature
- Remove commits from remote branch
new_feature
- Need to keep all the changes so that during removing the commits I do not lose any changes I have made so far.
- Create a new commit with all the changes I have made so far in the
new_feature
branch - Push the last commit to remote
new_feature
branch. At the endnew_feature
branch should have only one commit with all the changes I have made till now in this branch.