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-branch
git 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 stash
git checkout correct-branch
git stash pop
git commit
- Use cherry-pick
git reset HEAD~ --hard
git checkout correct-branch
git cherry-pick <commit-hash-from master>
git diff --staged