Push a clock frequency too far in config.txt and a Raspberry Pi 5 can refuse to boot, leaving you staring at a dead board and wondering if the overclock cooked the SD card. It almost never has. The settings are just text in a file, and there are two clean ways to get back in and remove the bad values. Re-flashing the card is not one of them, and is never necessary for this.
Quick Answer
Hold the Shift key during power-on. On a Pi 5 this temporarily ignores the overclock lines in config.txt and boots normally, so you can edit or delete the offending values. If holding Shift does not work, power down, pull the microSD card, and edit config.txt on another computer. Either way you keep your data and your installation.
First try: hold Shift at boot
Power the Pi down fully, then hold the Shift key on an attached keyboard as you apply power. This tells the firmware to skip the overclock overrides in config.txt for that one boot, so the Pi starts at safe stock clocks. Once you are at the desktop or terminal, open the config file and either delete the overclock lines or comment each one out by putting a # at the start. Save, reboot normally, and the Pi comes up clean.
Be aware that on the Pi 5 specifically, the Shift method does not always take. If the board still refuses to boot after a few tries, do not keep fighting it, move straight to the card-reader method below.
Reliable fallback: edit the card on another machine
This method always works because it does not need the Pi to boot at all. Power the Pi off, remove the microSD card, and plug it into another computer using a USB card reader. The boot partition mounts like a normal drive, and you can open config.txt in any text editor.
On current Raspberry Pi OS, that file lives at /boot/firmware/config.txt rather than the older /boot/config.txt location, so check there if the file is not where you expect. Remove your overclock lines, or comment them out with a # in front of each, then save and eject the card cleanly. Put it back in the Pi and it boots at stock speeds, fully intact.
Re-applying an overclock safely
Once you are back in, you can try again more carefully. The usual cause of a failed boot is asking for too high a clock without enough voltage to hold it stable. Step the frequency up in smaller increments, give the core a little more voltage if the documentation for your settings calls for it, and test each change before pushing further. Avoid jumping straight back to the exact values that failed, since that just repeats the crash.
Good cooling makes a real difference to how far a stable overclock will go, so an active cooler or a case with a fan is worth having before you chase higher clocks. You can see the compact and single-board systems Evetech stocks when you are building out a Pi project, and the computing gear local buyers reach for most covers the cooling and storage that keeps a tinkering setup reliable.
Frequently Asked Questions
Do I need to re-flash the SD card after a failed overclock?
No. The overclock lives in a plain text file on the boot partition, not in the operating system itself. You only need to edit or remove those lines, either by booting with Shift held or by editing the card on another computer. Re-flashing would wipe your data for no reason.
Why does holding Shift sometimes not work on a Pi 5?
The Shift-at-boot recovery is not perfectly reliable on the Pi 5, and some users find it ignored entirely. When that happens, editing config.txt directly from a card reader on another machine is the dependable fallback that always works.
Where is the config.txt file on a Pi 5?
On current Raspberry Pi OS releases the file is at /boot/firmware/config.txt. Older versions used /boot/config.txt, so if you do not find it in one place, check the other. Both are on the boot partition that mounts when you read the card on another computer.
How do I avoid the same crash when I overclock again?
Raise the clock in smaller steps, add core voltage where your settings need it, and test stability after each change rather than all at once. Do not reapply the exact values that already failed, and make sure the board has proper active cooling before pushing higher.
A failed overclock is a quick fix, not a dead board. If you are kitting out a Raspberry Pi project, browse the mini PC and single-board range at Evetech for the cooling and storage that keep your overclocks stable.