LoginSignup
0

More than 3 years have passed since last update.

Git Resetが役に立った

  • 状況

    • ローカルで作業を進めたはいいものの昔の状態に戻したくなった時
  • やったこと

    • git log --graph --all --format="%x09%an%x09%h %d %s" (これで過去のコミットログ見る、戻したいコミットのshaを確認)
    • git reset --hard 戻したい状態のsha

これでローカルのファイルたちを過去の状態に戻した

  • 余談
    • git resetする前に今のファイルなどをどこかにバックアップしておこう

備忘録

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
0