0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GitのVersionのresetとrevert

0
Last updated at Posted at 2023-01-11

・ローカルのVersion確認
Short Version コミット名
git log --oneline
 例:306e968 (HEAD -> develop, origin/develop) sync all controlled files
   3366cf8 sn-458
Long Version コミット名
 git log
・resetはそのコミットまでに戻る
 revert そのコミットが削除
 参照:https://zenn.dev/nekoniki/articles/f238efa56eb869
 例: git reset --hard 3366cf8
・強制リモートのreset (-f)
git push origin develop -f

・今のブランチの更新をクリアする
 まず、直近にreset
git reset --hard
 あと、クッリンする
  git clean -fxd
・gitにPush
git push origin develop
※ローカルBranch名とリモートBranch名が不一致の場合、
       git push origin localBranch:remoteBranch

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?