Created
October 21, 2019 13:33
-
-
Save yavuztas/e6890c41cdc83b9363d0c0b33ea338ba 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
# Assuming you did not commit the file, or add it to the index, then: | |
git checkout -- filename | |
# Assuming you added it to the index, but did not commit it, then: | |
git reset HEAD filename | |
git checkout -- filename | |
# Assuming you did commit it, then: | |
git checkout origin/master filename | |
# Assuming you want to blow away all commits from your branch (VERY DESTRUCTIVE): | |
git reset --hard origin/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment