gitでコミットを取り消す
git commit
してから取り消したくなった。すべてを。
該当レポジトリ内で
git reset --hard <commit no>
で行けるらしい。でも<commit no>
なんてわかりませんよ。
git log --oneline --graph
で左から二列目の現れる7桁の英数交じりの<commit no>
を使えば、その時点まで戻ることができる。
[alias]
graph = log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short
を~/.gitconfig
にコピペしておけばgit graph
でツリーがみられます。
コメント
コメントを投稿