Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6164715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:02:24+00:00 2026-05-23T22:02:24+00:00

This is probably quite simple but I’m currently a git noob and haven’t quite

  • 0

This is probably quite simple but I’m currently a git noob and haven’t quite got my head round the git branching model yet.

Suppose I currently have no branches other than master, but now I’ve made some changes since my last commit that I’ve decided I don’t want to keep (note: the changes are not committed yet). I don’t want to get rid of these changes just yet though – I’d like to put them in their own branch (called e.g. experimental_stuff) and then continue development from my previous commit. So I guess the steps are:

  • make current master a branch (git branch experimental_stuff ?)
  • go back to previous commit (git checkout <last_commit> ?)
  • make this my new master branch so that future commits continue from here (git ??? ?)

Is this the right approach and what git command do I need for the last part (if any) ?

[Note: this is just a local git repository for my sole use, if that make any difference.]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:02:25+00:00Added an answer on May 23, 2026 at 10:02 pm

    you are almost done.

    Assume you have made a commit on your development files. Then..

    git branch experimental_stuff

    git reset –hard HEAD^ (go back one previous commit of your master branch to continue your development)

    Assume you have not made a commit on your development files. Then..
    you need to save your current changes to a temporary directory

    git stash

    git checkout -b experimental_stuff (create and change branch to experiental_stuff)

    git stash pop (populate the temporary directory into experimental branch)

    git checkout master (return back to master, and no need to go back the previous commit this time as you don’t have that commit)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably quite simple but I haven't yet been able to wrap my
This is probably quite simple, but I just don't know how to do this...
This is probably a really simple question but one I've never quite worked out
This is probably quite simple but I've googled and can't find an answer. I
This is probably quite simple to do.. but I just can't think of how
This is probably pretty simple but I'm not quite sure how to implement it.
This is probably quite a simple problem, but it's causing me to scratch my
This is probably something extremely simple but I can't get my head around it
This is probably quite a simple question but very hard to google! I'm loading
This is probably quite a simple question, but I can't remember how to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.