--- tags: [tech] --- # Git cheatsheet ## Undo To undo the last commit but keep the changes run git reset with the soft flag and HEAD~1. To throw the changes away use the hard flag, but only on work that is not pushed. ## Branches Create a branch with git switch -c name. Delete a merged branch with git branch -d. Rebase a feature branch on develop before opening a pull request.