You're in a situation where you have made a commit to a wrong branch, or for whatever reason need to undo your last commit.
git reset --soft HEAD^1