Discard selected files

I want to undo my latest changes, but I also want to keep some of the files around.

I did a cocoapods update that added lots of new files to my repository and removed lots of files as well and modified even more files.

I would like to select all the changes and just tap `Reset...` to discard the changes.

However the `Reset...` menu action is disabled for new files that aren't yet tracked.

I solved my problem like this:

1. Copy the `Podfile` to my Desktop folder.

2. Do a `git --reset hard` to discard all the unwanted changes.

3. Copy the `Podfile` from my Desktop folder back into the repository.

This have happened to me several times, so it would be nice if it was easier to discard selected changes.

Perhaps make `Reset...` able to discard new files?

1 answer

This is a dangerous thing to add. Because these files are untracked, there is no way to recover them if you delete something accidentally.

For your situation, I would recommend committing the files you want to keep, then doing a git --reset hard to trash the rest.

You may also consider configuring git to ignore files with those extensions, if that works for you.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Asked 4 hours ago in Confluence

What are the resources that you use to learn more about Atlassian Products?

I am gathering information about resources available for Atlassian product knowledge transferring for a presentation in our local Atlassian User Group. I want to group them in four categories From ...

35 views 3 3
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you