Skip to content

Instantly share code, notes, and snippets.

@RoyalSix
Last active August 7, 2019 18:34
Show Gist options
  • Save RoyalSix/adbd78f8e879de04310030bd993bb6ce to your computer and use it in GitHub Desktop.
Save RoyalSix/adbd78f8e879de04310030bd993bb6ce to your computer and use it in GitHub Desktop.
Created with Copy to Gist
git reset --soft HEAD~1
git log # make sure the last commit is reverted successfully as you expect.
$ git stash
$ git log # copy the last-commi-hash
$ git revert <last-commit-hash>
$ git push origin HEAD # note, no force push is needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment