いつも忘れるのでメモ。随時更新中。

# Clone したら必ずユーザー名と Email を設定
git clone <remote-repository>
git config user.name <user-name>
git config user.email <email>

# ステージングをキャンセル
git reset HEAD

# リモートレポジトリの確認 (以下のいずれか)
git config --get remote.origin.url
git remote -v

# コミットするユーザーが想定と違う場合の確認箇所 (以下のいずれか)
cat $HOME/.gitconfig
cat $REPO_CLONE/.git/config

# 特定のコミットに戻す
git log --oneline  // コミットのハッシュ値を確認
git reset --hard <hash>
git push -f    // リモートのコミットを戻す。
### Gitlab の場合は Protected Branch の設定で Force Push を許可する必要がある