DEV Community


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


Better than downloading everything again

Discussion (0)

Editor guide