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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:34:44+00:00 2026-06-18T00:34:44+00:00

I created a local branch from a git repository that I am working on.

  • 0

I created a local branch from a git repository that I am working on. I have done this many times but for some reason the branch was created and put a bunch of random junk all over my code. (like random text and arrows).

So I decided to wipe the branch and attempt to recreate it since I have never seen this before. I went to switch branches and it would not let me because “Working copy is modified.” I attempted to commit changes but it said there were none to commit.

I then went on the terminal and tried to commit, discard, delete the branch, change branches. All of these went unnoticed (either ‘nothing to commit/discard’ or ‘cannot delete/change unmodified current branch’).

I am now stuck, not being able to change branches, commit the “changes”, discard changes, or remove the branch. Any thoughts?

  • 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-06-18T00:34:46+00:00Added an answer on June 18, 2026 at 12:34 am

    Do the following:

    git reset --hard HEAD
    git checkout master
    git branch -D <branch you want to delete>
    

    This will reset all the changes you currently have. And then will checkout the master branch to continue working on. And finally delete the branch you want to remove.

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

Sidebar

Related Questions

I have created a local branch X that at some point I pushed to
I have a local branch that I created via git branch --track <localFeatureBranch> <remoteSVNBranch>
I have a remote tracking branch tracked locally in my local repository using 'git
I've cloned repository A's master branch from git and created my own branch called
Here's the scenario: I have a local git repository that mirrors the contents of
I have a local branch work, where I created two new files a.py, b.py
I created a branch on my local Mercurial repository. I want to push to
How do I: Create a local branch from another branch (via git branch or
I just started working on a project that uses git as a repository. I've
I am working on a project and I have a central git repo. This

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.