I recently was messing around with my Pi when I accidentally deleted the taskbar. I cannot figure out how to bring it back.

I was on the desktop when I highlighted two icons on the left side of the taskbar, one called "Panel 1" and the other called "Panel 2". I figured I didn't want two panels, so I right clicked Panel 2 and deleted it. That ended up deleting my taskbar!

Linux, including Debian (and raspbian, which is derived from it) has a heterogeneous range of desktop GUIs, meaning there is not just one "Desktop Environment" (aka. DE) to rule them all. Different DE's deal with things like taskbars differently, so you need to be specific -- but presumably you are using LXDE, since that is the raspbian default. The raspberry pi community represents a very tiny minority of linux/debian/LXDE users, hence you are better off asking general questions about such elsewhere -- which is why I recommended this be closed.
– goldilocks♦Sep 2 '13 at 23:57

That said, I'm not an LXDE user personally (there are many other options, debian/raspbian wise), but I would bet if you click on the root window, or bump the cursor along an edge, you'll find a menu that leads you somewhere...if not, look for LXDE documentation online.
– goldilocks♦Sep 2 '13 at 23:59

This question appears to be off-topic because it is about Desktop Managers, and not about the Pi.
– kolinMay 13 '14 at 7:57

It is unclear from your question exactly what you have deleted.
I suspect it is the Panel.

I have never done this with LXDE and methods vary between environments.

You could try right-clinking on the desktop and running ObConf.
Alternatively try running lxpanel from a terminal.

The nice thing about the Pi, is that it is easy to restore the OS simply by reflashing the SDCard.
Of course, if you do this you will lose all customisation, programs you have loaded etc.
If this is important you should backup.

I haven't found the corrrect fix yet, but if I type "lxpanel &" in a terminal emulator I get a working taskbar again. (logout doesn't work) You can also put a line "lxpanel &" in /etc/X11/xinit/xinitrc to make it more permanent.

From this you should have figured out that lxpanel is just a program that runs, what you have to do to start it is more an annoyance than anything.

I had been logged in via VNC (and installed tightvncserver remotely via ssh) and when I came back to the physical machine the taskbar was gone, so I started Googling. VNC maintains a set of preferences files which mostly parallel X(org) in ~/$HOME/.vnc/xstartup and it's possible something went in there by accident. The more normal config files are in ~/$HOME/.config/lxpanel and lxsession, then some system-wide ones in /etc/xdg/lxpanel and lxsession. But it's quite a maze, the lazy fix would be to experiment with replacing those files with ones from another machine. Just remember you can run lxpanel from multiple places if you get stuck. I can get to obconf just fine but I don't see anything in there that looks like a fix. You want a default set of config files. And you'll need to get out of X and back in, or reboot, to be sure you've cured it.

And BTW this is in 64 bit Debian Stretch on a Rock64, looks about the same as the Raspberry Pi I'm typing this on. And the same as LXDE in Wheezy on an amd64 machine, it's not at all peculiar to a Raspberry Pi.

When you're poking around in there (I used mc) look for files with recent dates. But maybe they got deleted too. I see changes in ~/$HOME/.config/lxpanel/LXDE/panels/panel and ~/$HOME/.config/lxpanel/default/panels/panel. I've replaced those 2 files with an original panel file from another arm64 machine. Now when it's booting I see the taskbar flash twice but then it goes away. Still a work in progress. Keep notes, one of the principle Lnux trade secrets.

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).