Last active
November 5, 2018 10:55
-
-
Save boywijnmaalen/46715f247a078bcf73210d83ac753883 to your computer and use it in GitHub Desktop.
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
# Method #1 - revert the file and create a new commit (safe method) | |
$ git checkout HEAD^ -- /path/to/file | |
$ git add /path/to/file | |
$ git commit -m "revert changes on this file, not finished with it yet" | |
$ git push origin HEAD | |
# Method #2 - revert the file and update the last commit ('uncommitting' method) | |
# use this method only if you know what you're doing | |
$ git checkout HEAD^ -- /path/to/file | |
$ git commit --amend | |
$ git push -f origin HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment