修改未提交的信息
git commit --amend -m "new message"
回退版本
git log
git reset --hard commit_id
取消merge合并
git merge --abort
删除本地仓库当前关联的无效远程地址,并添加新的远程仓库地址
git remote -v
git remote rm origin
git remote add origin "git@..."
git remote -v
合并commit提交
1. git log
2. git rebase -i 0b619f6f282864cf26c78d6dd24ff72bfa9a22b0 // 合并目标之前的那一次hash
3. pick => s // squash
4. :wq
5. add new commit
6. :wq
7. git log // 应该合并commit成功了
8. git pull --rebase origin branch // 防止多出很多无用的merge commit
9. git push origin branch // 提交到指定分支
取消
git rebase --abort
git stash
git stash save 'temp'
git stash -u
git stash save 'temp' -u
git stash drop [<stash>]