LoginSignup
1
0

More than 1 year has passed since last update.

#git変更を戻す パターン1
ローカルリポジトリ

$ git log

commit 1483ccd9e5a15f150e55a005018bd425bfc8a111
Author: hoge <hoge@gmail.com>
Date:   Thu Feb 17 00:00:00 2022 +0900

commit を指定し、変更を確認

git show 1483ccd9e5a15f150e55a005018bd425bfc8a111

変更を戻す

$ git reset 1483ccd9e5a15f150e55a005018bd425bfc8a111

戻した変更をリモートリポジトリに反映する

$ git push -f //-fで強制push

#git変更を戻す パターン2
ローカルリポジトリ

$ git log --oneline --graph

* d1bd2ec (HEAD -> test, origin/test) Revert "コメント"
* 0b4a8c6 コメント
* 1483ccd コメント

変更を確認

$ git show 0b4a8c6

IDを指定

$ git revert 0b4a8c6

戻した変更をリモートリポジトリに反映する

$ git push -f //-fで強制push
1
0
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
1
0