dump flash+bootloader to hex backup

I bought a PPM encoder that uses ATmega328P, and I want to try to develop some new code for it for a personal project. If my project is worst then original I want to roll back to original flash+bootloader+eeprom.

How to backup the content of Atmega328P to a file that I can restore later?