Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

How to undo/remove commits that removed functionality that is needed to be restored.

Let's say you created a branch that removed some functionality/code and merged it back into master.

 

Then later on, down the road after any number of other branches/commits/merges, let's say you want to add back that functionality/code from the past that was removed and also keep all the work done after that code was removed.

 

What is the best way to do this, and/or approach it if you think this scenario may happen? Basically how to remove code from a website, but also keep it for later use using git and GitHub.

 

Thanks!

1 Reply
Highlighted
Commander Lvl 2
Message 2 of 2

Re: How to undo/remove commits that removed functionality that is needed to be restored.

If I did not understand it you could perform a reset to commit before the commit where this feature was deleted, then create a branch from it and then a pull request. Post the result branch here, because i'm curious to know if it will work.