git go back to old commit and make that master code example Example: make previous commit master git checkout master git reset --hard <old_commit_id>