Skip to content

Instantly share code, notes, and snippets.

@DenisDov
Last active June 15, 2020 08:18
Show Gist options
  • Save DenisDov/e9706792b9d5e12e01b8c6d9e4d7158d to your computer and use it in GitHub Desktop.
Save DenisDov/e9706792b9d5e12e01b8c6d9e4d7158d to your computer and use it in GitHub Desktop.
Git notes

Revert a Git repository to a previous commit

git reset --hard [previous Commit SHA id here]
git push origin [branch Name] -f

It will remove your previous Git commit. If you want to keep your changes, you can also use:

git reset --soft [previous Commit SHA id here]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment