Skip to content

Instantly share code, notes, and snippets.

@blurymind
Forked from eduncan911/Revert-Gist.md
Created July 18, 2020 09:23
Show Gist options
  • Save blurymind/d9c564ef36b38479025b11f1c48cc73f to your computer and use it in GitHub Desktop.
Save blurymind/d9c564ef36b38479025b11f1c48cc73f to your computer and use it in GitHub Desktop.

Revisions

  1. @eduncan911 eduncan911 renamed this gist Jun 3, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @eduncan911 eduncan911 revised this gist Jun 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ It was not exactly obvious. Here's how to revert a Gist commit!
    Checkout the gist like a normal git repo:

    # replace the Gist ID with your own
    git glone git clone [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git
    git clone [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git

    Treat it like a normal repo. Edit, force push, etc.

  3. @eduncan911 eduncan911 revised this gist Jul 27, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,6 @@ When you are ready, you will need to force push as the remote has newer commits:

    Want to revert the last change?

    git reset --hard HEAD~1
    git push -f origin master
    git reset --hard HEAD~1 && git push -f origin master

    Yay! You reverted!
  4. @eduncan911 eduncan911 revised this gist Jul 27, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -15,9 +15,9 @@ When you are ready, you will need to force push as the remote has newer commits:

    git push -f origin master

    # Example: Revert the last commit
    # Example: Revert the last commit to your Gist

    For example, want to revert the last change?
    Want to revert the last change?

    git reset --hard HEAD~1
    git push -f origin master
  5. @eduncan911 eduncan911 revised this gist Jul 27, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -9,9 +9,13 @@ Checkout the gist like a normal git repo:

    Treat it like a normal repo. Edit, force push, etc.

    # Force Push

    When you are ready, you will need to force push as the remote has newer commits:

    git push -f origin master

    # Example: Revert the last commit

    For example, want to revert the last change?

  6. @eduncan911 eduncan911 revised this gist Jul 27, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ Checkout the gist like a normal git repo:

    Treat it like a normal repo. Edit, force push, etc.

    You will need to force push, as the remote has newer commits:
    When you are ready, you will need to force push as the remote has newer commits:

    git push -f origin master

  7. @eduncan911 eduncan911 created this gist Jul 27, 2017.
    21 changes: 21 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    # Revert / Undo a Gist Commit

    It was not exactly obvious. Here's how to revert a Gist commit!

    Checkout the gist like a normal git repo:

    # replace the Gist ID with your own
    git glone git clone [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git

    Treat it like a normal repo. Edit, force push, etc.

    You will need to force push, as the remote has newer commits:

    git push -f origin master

    For example, want to revert the last change?

    git reset --hard HEAD~1
    git push -f origin master

    Yay! You reverted!