What is Git? and how to master it in the terminal.
Undo commits that have not been pushed yet
Okey, so you have fucked up, maybe commit something to the wrong branch. No worries, don’t push it.
What you want to do is run the reset command:
git reset <sha1 of commit>
You will not lose your changes.