Last active
August 29, 2015 14:02
-
-
Save kazu69/ab91d0bd5a4eb54716f1 to your computer and use it in GitHub Desktop.
git initial commit revert
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の参照は以下に存在している | |
tree -L 1 .git/refs | |
.git/refs | |
├── heads | |
├── remotes | |
├── stash | |
└── tags | |
# 例えば現在のmasterのhashは | |
cat .git/refs/heads/master | |
b3bd91d7995f2387a04a849e26a925ef88ea8063 |
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 update-ref -d HEAD |
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 reset --hard HEAD~1 |
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 update-ref -h | |
usage: git update-ref [options] -d <refname> [<oldval>] | |
or: git update-ref [options] <refname> <newval> [<oldval>] | |
or: git update-ref [options] --stdin [-z] | |
-m <reason> reason of the update | |
-d delete the reference | |
--no-deref update <refname> not the one it points to | |
-z stdin has NUL-terminated arguments | |
--stdin read updates from stdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment