DEV Community

baris
baris

Posted on

Answer: Throw away local commits in Git

If your excess commits are only visible to you, you can just do git reset --hard origin/<branch_name> to move back to where the origin is. This will reset the state of the repository to the previous commit, and it will discard all local changes.

Doing a git revert makes new

</p>





Better than downloading everything again

Top comments (0)