- Pull the newest work first
git pullDo this before you start and again before you push. It brings down anything other people added since you last looked.
- Push your commits
git pushOnly commits are sent. Save your changes with a commit first.
- First push of a new branch
git push -u origin mainOnly needed once per branch. After that, plain git push and git pull know where to go.
Check it worked
- Check you're in step with GitHub
git statusIt should say your branch is up to date with origin.
Undo it
- Undo a pull that just went wrong
git reset --hard ORIG_HEADOnly right after the pull. It also throws away changes you haven't committed.
- Pull the newest work first
git pullDo this before you start and again before you push. It brings down anything other people added since you last looked.
- Push your commits
git pushOnly commits are sent. Save your changes with a commit first.
- First push of a new branch
git push -u origin mainOnly needed once per branch. After that, plain git push and git pull know where to go.
Check it worked
- Check you're in step with GitHub
git statusIt should say your branch is up to date with origin.
Undo it
- Undo a pull that just went wrong
git reset --hard ORIG_HEADOnly right after the pull. It also throws away changes you haven't committed.
- Pull the newest work first
git pullDo this before you start and again before you push. It brings down anything other people added since you last looked.
- Push your commits
git pushOnly commits are sent. Save your changes with a commit first.
- First push of a new branch
git push -u origin mainOnly needed once per branch. After that, plain git push and git pull know where to go.
Check it worked
- Check you're in step with GitHub
git statusIt should say your branch is up to date with origin.
Undo it
- Undo a pull that just went wrong
git reset --hard ORIG_HEADOnly right after the pull. It also throws away changes you haven't committed.

New to Push and pull? I explain it in plain English on Layman Terms.