LoginSignup
9
3

More than 5 years have passed since last update.

git revertでいつもわからなくなることメモ

Posted at

git revertをしたいときいつも調べること、わからなくなることをメモっておきます。

git revertで指定するcommitはどれ

git revertで指定するcommitは

なかったことにしたいcommit

です。
なかったことにしたいcommitの次のcommitでも前のcommitでもありません。
git revertは簡単にいうと

指定したcommitの変更分をなかったことにするcommitを作ってくれるコマンド

みたいな感じなのでそれを覚えておけば大丈夫だと思います。

ターミナルでrevertするとよくわからない画面が出てくる

Revert "remove error"
This reverts commit ba66...(略)

から始まる画面が出てくるときは
:q!と打って実行すれば元に戻れると思います。
できなければescボタンを押してからやるとうまくいくかもしれないです。

9
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
3