Skip to content

Instantly share code, notes, and snippets.

@za
Created October 14, 2021 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save za/ae0ce9162818dacc9f3b2f9bfc8400f9 to your computer and use it in GitHub Desktop.
Save za/ae0ce9162818dacc9f3b2f9bfc8400f9 to your computer and use it in GitHub Desktop.
Let's say we're trying to fix a bug. We've tried with a few commits. But it still didn't work.
So let's checkout to commit that we want and also push it to git server.
```
$ git reset <$hash-id>
$ git checkout -- . (to cancel any changes)
$ git push -f origin <$branch-name>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment