Often, when I'm using a brush or stamp tool, I find that the default black/white brush colors have been changed to white/white. The only keystrokes I'm aware of are the alt key to sample and the bracket keys to change brush size. I can't figure out what set of keys I'm hitting that sets the black/white to white/white. Does anyone have any idea what is happening?
To reset Foreground Colour and Background Colour hit D on your keyboard.
To invert them, X (the Bg color goes to the Fg, and vice versa>
What you might have done accidentally is an Alt+click on the background: it samples the color instead of painting.