This is a bit of shameless self-promotion, but I think that anyone running an ArchLinux machine will probably appreciate this.
As anyone who has run ArchLinux knows, there is a common phenomenon of upgrading your system and things breaking. If it's just some awkward behavior of some of the tools you can typically resolve it with ease, but there have been times for myself when, because I use Nvidia drivers, I cannot even get my graphical environment running and I have to revert the last upgrade. Most of the time, however, I've had to do this manually, since I did not know of any tool that does it, at least not the way I wanted, which is just an automatic undoing of the last pacman transaction.
To remedy this problem I decided to write a hobby script that would do this work for me based on the pacman logs, using the local cache and even the ArchLinux Archive if the package cannot be found locally. I've even added support for my AUR helper of choice, yay.[1] This script is called pacundo and can be found in my personal repository[2] as well as in the AUR for an easier installation.[3]
As of right now (pacundo v1.1) the script only supports bare pacman and yay, but if you use a different AUR helper and want to contribute this functionality for your favorite AUR helper, feel free to send me a patch following the contributing guidelines.[4] As noted there, you can also find a mirror of my repository on GitHub[5] where I can also receive issues and pull requests (but please read the notes about pull requests that I wrote in the contributing section mentioned above).
Hopefully this helps out a few people to fix their ArchLinux systems. I've also run it on Manjaro and it seems to work fine there as well, and my guess is it should work on any ArchLinux derivative distribution.
God bless, and happy hacking!