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

  • Home
  • SEARCH
  • 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 4530638
In Process

The Archive Base Latest Questions

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

I messed up pretty badly on this one. I was working on a branch

  • 0

I messed up pretty badly on this one.
I was working on a branch ‘feature1-branch’ and commited the changes but did not merge them with master.

The git log shows something like:

git log
commit 0829f9f0b68ce58ca37efd4e07cf3e8b3b67ed49
Date:   Thu Apr 21 00:38:58 2011 -0700

feature1-branch lots and lots of changes

I am not sure what I was thinking but I did:

git checkout master

This deleted a bunch of new files added with the branch ‘feature1-branch’.

Now git status shows:

 git status
 # On branch feature1-branch
 # Changed but not updated:
 #   (use "git add/rm <file>..." to update what will be committed)
 #   (use "git checkout -- <file>..." to discard changes in working directory)
 #
 #  deleted:    app/controllers/activations_controller.rb
 #  deleted:    app/controllers/settings_controller.rb
 #  modified:   app/controllers/application_controller.rb
 #  deleted:    app/controllers/products_controller.rb

The files mentioned as deleted are not there anymore.
How do I get them back to the state where I was in with commit

0829f9f0b68ce58ca37efd4e07cf3e8b3b67ed49

I am worried if these files are gone forever.

Thanks for your help.

Adding additional information:

git log -1 feature1-branch
commit 0829f9f0b68ce58ca37efd4e07cf3e8b3b67ed49 
Date: Thu Apr 21 00:38:58 2011 -0700 
feature1-branch lots and lots of changes

This is what git checkout returns:

git checkout feature1-branch 
D app/controllers/activations_controller.rb 
D   app/controllers/products_controller.rb 
M app/controllers/application_controller.rb

git status returns:

git status 
# On branch feature1-branch 
# Changed but not updated: 
# (use "git add/rm <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# # deleted: app/controllers/activations_controller.rb 
# deleted: app/controllers/products_controller.rb 

no changes added to commit (use "git add" and/or "git commit -a")
  • 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-21T13:49:21+00:00Added an answer on May 21, 2026 at 1:49 pm

    I suspect that what has happened is that you deleted these files at some point, but didn’t commit their deletion. That means that when you switch branches they will still be shown as deleted, since git tries to preserve the modifications in your working tree when you change branch, unless that would lose data or create problems.

    Just reading the output of git status that you’ve quoted, it looks as if you can restore the deleted files by, for example:

    git checkout -- app/controllers/activations_controller.rb app/controllers/settings_controller.rb
    

    … while you’re on feature1-branch.

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

Sidebar

Related Questions

I'm not 100% sure it wasn't always this way and I never noticed... but
I messed my local branch of a project, and i want to revert my
I've messed with Access a little bit in the past, had one class on
One of my colleagues has totally messed up the contents of a directory in
as usual I'm working with my messed up database and I found that there
I've downloaded the latest update of XAMPP which pretty much messed up my old
This is a pretty complicated question so be prepared! I want to generate some
I have had pinch-to-zoom working pretty well for a few application versions now using
I'm pretty clueless on what the problem might be, but what works fine here
Ok, I am pretty new to git, probably this was asked and answered already.

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.