I want to add one tool that (looks like) still has no mention there: clipboard manager.
Clipboard manager allow you to store all clipboard history.
Thats not the best solution, but at least for me with it I able to copy some original and intermediate states of code few times and return to it anytime in the future.