https://developers.google...images?hl=nl#instructionsInstructions
You will find these files useful if you have used the Android Open-Source Project, flashed custom builds on your device, and wish to return that device to its factory state.
In order to use these files, you need to have the fastboot tool in your PATH. That tool is compiled as part of every configuration of the Android Open-Source Project and is the tool used to flash custom builds on your device. On GNU/Linux systems, this also implies that you have configured USB access as mentioned in the machine setup instructions.
Your device needs to be in fastboot mode, with the bootloader unlocked. The relevant key combinations and commands are documented on the page about building for devices.
You need to uncompress each download before use, which creates a new directory for that exact download. That directory contains a ./flash-all.sh script, which handles the various operations, installs the necessary bootloader, baseband firmware(s), and operating system. Note that this operation deletes all user data by default.
After restoring a factory image, it is recommended that you lock the bootloader, for security reasons.
dus je device moet unlocked zijn en deze zijn alleen te flashen via fastboot (scripted), wellicht zijn er ook toolkits die dit voor je doen.
Let op standaard wordt je userdata ook gewiped (als dat niet al zojuist bij de unlock is gebeurd)
een unlock is altijd full wipe inc sdcard
een full fastboot stock flash is volgens mij een full wipe excl sdcard (weet ik niet heel zeker)
je kan overigens het fastboot script aanpassen dat ie je userdata met rust laat