git reset HEAD@{index}git reset --hard <commit-index>
git add <file-name>/ <.>git commit --amend// Use this to just ammend the last commit message
(while in master do:)
git branch -b new-branchgit reset HEAD~ --hard//remove that commit from mastergit checkout new-branch
- Use stash
git reset HEAD~ --soft// reverses the commit but leaves the changes availablegit stashgit checkout correct-branchgit stash popgit commit
- Use cherry-pick
git reset HEAD~ --hardgit checkout correct-branchgit cherry-pick <commit-hash-from master>
git diff --staged