If you are doing anything non-trivial in software development, you should definitely be using a versioning system. With that you could have just “reverted all changes” with a few button clicks.
Either that or be super strict about making backups of backups of your entire project.