Skip to content

Instantly share code, notes, and snippets.

@jyap808
Created December 17, 2020 09:50
Show Gist options
  • Save jyap808/905de17792910b53a360a25250b741a5 to your computer and use it in GitHub Desktop.
Save jyap808/905de17792910b53a360a25250b741a5 to your computer and use it in GitHub Desktop.
Useful random notes

Undo Git changes (also pushed Git changes)

In the server, move the cursor back to the last known good commit:

git push -f origin <last_known_good_commit>:<branch_name>

Locally, do the same:

git reset --hard <last_known_good_commit>
#         ^^^^^^
#         optional

FROM: https://stackoverflow.com/a/36177806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment