Last active
December 13, 2019 01:54
-
-
Save adenosinew/c53e28bac6e14dc737ea1396edbe2db0 to your computer and use it in GitHub Desktop.
[Git Commands]
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
# If you are getting below error | |
# error: Untracked working tree file '***' would be overwritten by merge. | |
git reset --hard HEAD | |
git clean -f -d | |
git pull |
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
# https://www.git-tower.com/learn/git/faq/undo-last-commit | |
git reset --soft HEAD~1 | |
# Note the --soft flag: this makes sure that the changes in undone revisions are preserved. After running the command, you'll find the changes as uncommitted local modifications in your working copy. | |
# If you don't want to keep these changes, simply use the --hard flag. Be sure to only do this when you're sure you don't need these changes anymore. | |
git reset --hard HEAD~1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment