Throw away local commits in Git
If you can see only the excess commits you can just do git reset --hard origin/To move back to the origin. This will reset the state of the repository to the previous commit and discards all changes. If you want to make new commits to remove old commits in a way that keeps everyone's history will be the same. this can…
Answered Jul 14, 2021 · 1.4K Views Read answer →