Quantcast
Channel: How do I delete a commit from a branch? - Stack Overflow
Viewing all articles
Browse latest Browse all 80

Answer by Karsten for How do I delete a commit from a branch?

$
0
0

Removing a commit is very easy, but it is better to save it somewhere maybe there is some code line which would be useful. (I write this because something similar had happen to me some days ago).

So best is to start with some

git reset --soft HEAD~N

with N for the commits to go back and than some

git stash push -m "some useful comment"

to save a patch for further use. Than your are the N commits back.


Viewing all articles
Browse latest Browse all 80

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>