A technique to be aware of when building startups or dealing with the fear of copyright lawsuits. They tend to be more often referred to as a researcher's journal or an inventor's journal, but the idea can be applied to programming.
Essentially your planning and development workflow should include a kind of documentation journal that follows the thread of your work/thoughts/inspiration/etc. The benefits of this are two-fold, self-documentation and as evidence in a potential lawsuit. This second aspect imposes a few restrictions in order to be admissible.
- Pages must be tamper evident (no perforations, no spiral/wire bound notebooks).
- Pages must be numbered and dated.
- All work must be done in ink (mistakes should not be erased, only crossed out).
This is just a quick to-the-point summary. You can see something more in-depth at http://snowandbones.com/2013/09/30/on-the-programmers-journal/.