Skip to content

Instantly share code, notes, and snippets.

@kumlali
Last active December 29, 2017 08:00
Show Gist options
  • Save kumlali/f755bd94bae41d43a3049f745fbfad33 to your computer and use it in GitHub Desktop.
Save kumlali/f755bd94bae41d43a3049f745fbfad33 to your computer and use it in GitHub Desktop.
Rolling back to a specific git commit

Rolling back to a specific git commit

WARNING: Using this is dangerous in a collaborative environment: you're rewriting history

References:

$ git clone $URL
$ cd $PROJECT_NAME
$ git reset --hard $SHA1
$ git push -f origin $BRANCH

Sample

$ git clone https://github.com/kumlali/handyjenkins.git
$ cd handyjenkins
$ git reset --hard cdc581a07e5dd6a751042b5a29fcf3808c07c308
$ git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment