2

Is it possible to go back to a previous revision and then branch it without affecting the current master version.

A quick backstory:

We updated a template for a company website that have a more robust navigation. Turn out they can't afford the new changes and just want to update their current navigations css.

Right now I'm 10+ version/commit ahead of the old navigation. So I'm wondering if it's possible to work on that version and just create a branch from that point on.

Kinda like this:

 "new" old version branch / (init) --- old version --- current version 

This way if the company ever do want to update it to the new navigation I can just continue it from the current master version.

Sorry if this sounds confusing, not familiar with version controls terms

3
  • 2
    Sure. git checkout -b newBranch oldCommitHashOrBranchName. Commented Apr 13, 2017 at 16:55
  • 2
    And you can find the commit hash either with git log or on github. It's the really long string with letters and numbers, but you only need the first few characters (the first 8 or so) Commented Apr 13, 2017 at 16:56
  • @JBNizet It worked perfectly. Thanks! Commented Apr 13, 2017 at 18:27

1 Answer 1

1

I would go with:

git checkout <old_version_commit_hash> git checkout -b "<new_old_version_branch_name>" 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.