Skip to content

Instantly share code, notes, and snippets.

@malwaremily
Last active September 18, 2021 18:02
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 malwaremily/7535af83b71bebc7c51d7f8a4d062268 to your computer and use it in GitHub Desktop.
Save malwaremily/7535af83b71bebc7c51d7f8a4d062268 to your computer and use it in GitHub Desktop.
emily's git cheatsheet

HOW TO ROLL BACK COMMIT

Find the commit you want to roll back to

git log

Tell git which commit you'd like to reset your local repo to

git revert --no-commit 1e58b1d7... HEAD
git commit

Now update the repositry in Github

git push

HOW TO ALIAS GIT ADD & GIT COMMIT

Tell git you want to edit global configuration

git config --global --edit

Add this line to the bottom of the file

[alias]
        ca = !git add -A && git commit -av
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment