this is something beyond the scope of this forum. Anyway this is a system/filesystem level issue that depends on what operating system and what filesystem you use. And the command would be different on all systems.
But its probably easier and more constructive if you use a version controll software instead. As this and several other highly usefull functions are built into them.
So consider using something like mercurial, git, perforce... Then you dont need the thing you ask for.