Delete last git commit

Didn’t pay attention and whoops, I managed to commit a whole bunch of files in a project that shouldn’t be in there. Nothing had been pushed yet, so I was wondering whether there would be a shortcut of getting rid of that last commit. And, lo!, there is:

git reset --soft HEAD~1

Many thanks to Nurullah Akkaya for posting that solution.