Created
July 7, 2017 19:12
-
-
Save raulsouzalima/ac43fc96bd84a8a591ee55f9938216b7 to your computer and use it in GitHub Desktop.
Change old commit on git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase -i @~5 # Show the last 5 commits in a text editor | |
In the default editor, modify pick to edit in the line whose commit you want to modify. | |
Make your changes and then commit them with the same message you had before: | |
$ git commit --all --amend --no-edit #to modify the commit, and after that | |
$ git rebase --continue #to return back to the previous head commit. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment