Let's say you're working on the whizbang feature. You branch off of develop to the new feature/whizbang branch and start coding. You commit with various things along the way. You commit one time and realize you broke it, so you fix it and commit again. Several commits later it's all set, tested, and ready to merge into develop. How do you squish all those intermediate commits into one, finished commit?
From your feature/whizbang branch, type git rebase -i develop
Then you'll get a rebase editor with some helpful comments as a cheatsheet:
