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 4046054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:30:48+00:00 2026-05-20T13:30:48+00:00

I have just used git add -p to add a bunch of changes to

  • 0

I have just used git add -p to add a bunch of changes to the index, and I just realised that I missed a change that should’ve gone into the previous commit.

I can’t commit --amend now because I’ve added all these new changes to the index, and I don’t want to use ‘git reset’ to remove them all from the index as it will take ages to add them all back in again.

What I need is something like git stash that will only stash the index – it should leave the working files alone. Then I can stash the index, add the missing change, commit it, then pop the stash and have my index back the way it was.

It doesn’t look like git stash is able to do this, but am I missing something? Thanks!

  • 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-20T13:30:49+00:00Added an answer on May 20, 2026 at 1:30 pm

    Simplest way is to leave off that change right now, make your new commit, then create a second commit with just that change you want to use to amend and then use git rebase -i to squash it with the original HEAD.

    An alternative would be to make your commit, tag it, roll back with git reset HEAD^, add that one change and amend HEAD, then cherry-pick your tagged commit.

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

Sidebar

Related Questions

I have just started using git. Rebase is great stuff. I should have used
I have used git update-index --assume-unchanged on some files to keep my changes to
Just trying to understand that - I have never used it before. How is
I have a correlated subquery in an update that used to work just fine
I have just used Git programming. The problem case is as follows: I have
Was trying to commit some changes. I used git add to add any new
I have just a master branch in my git repo. I commited a change
I have a git repository with two branches; one for code that's used for
To localitie items in the standard directories, I have just used either one of
I have used just Windows for programming so far. Now, I have an internship

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.