I'm working on a git branch that I branched out from the main branch and I have made a number of commits to it but now I want to reset that branch to its earlier state when I first branched it from the main branch. what I mean is that I want to remove all commits I have already committed and push in there so that it becomes exactly the same as the main.
when I did this :
git reset --hard origin/the-branch-name
It give this:
HEAD is now at 4176992 This is fifth commit to new branch
which is the last commit I made. But I want to remove all commits I have made.
Please, how can I achieve this?