Problem 1: I committed and pushed my API key
Solution: Remove a commit by following steps on this blog post

Problem 2: I want to undo my commits before I push
Solution: Follow steps on this stackoverflow answer