git - going back to a certain commit -


this question has answer here:

i needed rollback branch few commits back, newer commits introduced bugs.

i tried solve problem of stackoverflow , googling git tutorials, feel made worse. right git branches this:

enter image description here

the blue line called development, pink - master.

my actions checkout new branch selected commit, checkout master rid of detached head , merge 2 branches. merging brought bugs "bad" commit.

how can rollback first bullet point in tree , erase buggy commits existence?

there many ways this. if on master, way i'd follows:

  1. git branch safety keep branch @ old head
  2. git reset --hard abc123 move master old commit, assuming commit abc123
  3. git branch -d safety discard safety branch, if desired

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -