How do I undo "export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile"
You certainly don't need to reinstall - just remove the offending last line of the file and restart terminal to see the effects.

If you don't know how to edit the file from terminal, you can open the file in your system's default plain text editor:

/usr/bin/open ~/.bash_profile


Just delete the last line and save the file. (The >> tacks the output of the echo on to the end of the file)  At that point, quit terminal, reopen terminal and test brew doctor again.

Apple has an overview of editors you can use in terminal if you want to edit files more regularly.


http://support.apple.com/kb/HT4850


For beginners, the nano editor is perhaps the easiest since it has visible help for basic commands. You can get some more guided help on nano from the web by opening the URL in your preferred browser (or having terminal do that for you open http://www.nano-editor.org/).