DEV Community

loading...

Answer: Throw away local commits in Git

boyukbas profile image baris ・1 min read

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

Discussion (0)

pic
Editor guide