Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A -> B -> C -> D -> HEAD
- $ git revert --no-commit D
- $ git revert --no-commit C
- $ git revert --no-commit B
- $ git commit -m "the commit message"
- $ git revert --no-commit D
- $ git revert --no-commit C
- $ git revert --no-commit B
- $ git commit -m "the commit message"
- $ git revert --no-commit D
- $ git revert --no-commit C
- $ git revert --no-commit B
- $ git commit -m "the commit message"
- $ git checkout -f A -- .
- $ git commit -a
- $ git reset --hard A
- $ git reset --soft @{1} # (or ORIG_HEAD), which is D
- $ git commit
- $ git reset --hard A
- $ git reset --soft @{1} # (or ORIG_HEAD), which is D
- $ git commit
- git revert master~3..master
- A <- B <- C <- D <- BCD' <- HEAD
- # revert all commits from B to HEAD, inclusively
- $ git revert --no-commit B..HEAD
- $ git commit -m 'message'
- git reset --hard a
- git reset --mixed d
- git commit
- git revert --no-commit HEAD~3..
- git diff HEAD commit_sha_you_want_to_revert_to | git apply
- git checkout <branch_name>
- git reset --hard <commit Hash for A>
- git push -f
- git checkout testing
- git reset --hard abc1234
- git push -f
- for i in `git rev-list <first-commit-sha>^..<last-commit-sha>`; do git revert -n $i; done
- for i in `git rev-list <first-commit-sha>^..<last-commit-sha>`; do git revert --no-edit -s $i; done
- o---o---o---o---o---o--->
- fff eee ddd ccc bbb aaa
- for i in `git rev-list eee^..bbb`; do git revert --no-edit -s $i; done
- $ git checkout -f <target-commit> -- .
- $ git diff --name-status --cached <target-commit>
- $ git rm <filespec>[ <filespec> ...]
- $ git commit -m 'revert to <target-commit>'
- $git diff <target-commit> <current-commit>
- git revert HEAD
- git revert HEAD~2
- git revert HEAD~4
- git rebase -i HEAD~3 # pick, squash, squash
Add Comment
Please, Sign In to add comment