version control - Git revert back to previous commit and keep committing new changes to master -


i'm on branch master, head pointing last commit on master , i'm wondering if following possible:

  1. revert previous commit b.
  2. move commits b (b excluded) new branch "experimental". after master's last commit should b , "experimental"'s last commit should a.
  3. make new commit c after b under branch master. after master's last commit should c

all commits pushed origin, , working directory clean (no staged or unstaged changes).

any guidance appreciated.

git checkout -b experimental    // create , switch branch "experimental" existing changes master. git push origin experimental    // push "experimental" remote origin. git checkout master             // switch branch "master" git reset --hard <commit>       // bring head <commit> mentioned. also, remove uncommitted changes "master" git add <files>                 // add files committed "master" git commit -m "new commit c"    // can new commit "c" master current branch. git push origin master          // push master remote 

hope solves issue.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -