First of all, we need to do some housekeeping. Go back to the grocery repository and clean up the working tree; double-check that you are in the master branch, and then do a git reset --hard master:
[24] ~/grocery (master) $ git reset --hard master HEAD is now at 603b9d1 Add a peach
This allows us to discard all the latest changes and go back to the latest commit on master, cleaning up even the staging area.
Then, delete the bug branch we created some time ago; the command to delete a branch is again the git branch command, this time followed by a -d option and then the branch name:
[25] ~/grocery (master) $ git branch -d bug error: The branch 'bug' is not fully merged. If you are sure you want to delete it, run 'git branch -D bug'.
Okay, Git has an objection. It says the branch is not fully merged, in other words, if you delete it, the commit within it will be lost. No problem, we don't need that commit; so, use the capital -D option to force the deletion:
[26] ~/grocery (master) $ git branch -D bug Deleted branch bug (was 07b1858).
Okay, now we are done, and the repository is in good shape, as the git log command shows:
[27] ~/grocery (master) $ git log --oneline --graph --decorate --all * 603b9d1 (HEAD -> master) Add a peach | * a8c6219 (melons) Add a watermelon | * ef6c382 (berries) Add a blackberry |/ * 0e8b5cf Add an orange * e4a5e7b Add an apple * a57d783 Add a banana to the shopping list