Undoing git action — in case you messed up your commits

The magic

List all your git history

git reflog
a24c15b (HEAD -> master) HEAD@{0}: cherry-pick: Add rabbitmq connection tests
fdd75ca HEAD@{1}: cherry-pick: Update rabbitmq credentials
06091ac HEAD@{2}: commit (cherry-pick): Add scafold for rabbitmq connection
11ef50f HEAD@{3}: reset: moving to HEAD@{3}
a3640ed HEAD@{4}: commit (cherry-pick): Update rabbitmq credentials
11ef50f HEAD@{5}: checkout: moving from add-rabbitmq-connection to master

Undo your wrong step, pick one of these commands

git reset --soft HEAD@{3}
git reset --hard HEAD@{3}