I have a use case where we have to maintain multiple versions of code in master branch. However there might be cases wherein i have to clone from older version (older commit), make changes to that and push it back right after that commit. Refer to below example :-
Master branch :- A-B-C-D-E-F
Use case - clone from D, make changes and push it after D (i.e. D'). Also, whatever changes made after cloning shouldn't be reflected in E and F.
After Changes the Master branch should be like - A-B-C-D-D'-E-F
Is there a way to do this in git ?