I believe you are referring to "Sallie," the mascot of the 11th PA Infantry, a brindle bull terrier, who "joined the regiment as a puppy in the early days of the war. Through it all, she provided a source of comfort, pride, and inspiration for her fighting comrades. Sallie would hold her position on the line and bark fiercely at the enemy. One thing was clear; a bond of unconditional love and loyalty existed between Sallie and the men.
"At Gettysburg, the gallant little dog became separated from her unit in the confusion of the first day’s battle. Refusing to pass through the Rebel lines, Sallie returned to her unit’s former position atop Oak Ridge, staying among her fallen comrades, licking wounds of the injured and watching over lifeless bodies. Days later, after the Confederates retreated from the field, she was found weakened and malnourished, amidst the dead and debris. A compassionate soldier recognized her and returned Sallie to her unit. No doubt, the reunion was joyful!
"Miraculously Sallie had avoided being shot at Gettysburg, but on May 8, 1864, the same day Captain Keenan was killed; she was shot in the neck by a minie ball. After being examined at the field hospital, a surgeon pronounced she would live but the bullet could not be removed. After a few days recuperation at the hospital, she returned to the unit with the painful and annoying wound, eventually becoming a battle scar. Reportedly, upon reporting for "active duty" she felt it necessary to tear the seat out of the pants of a young soldier from another unit running away from the battle line as he crossed along the back of the "Old 11th."
"Fatefully, Sallie was in her usual position on February 6, 1865, at Hatcher’s Run, Virginia, when a bullet struck her in the head, killing her. Heartbroken over the loss of their beloved mascot, the men buried her on the field of battle under heavy enemy fire."
You can see an actual picture of Sallie at my source: http://www.nycivilwar.us/sallie.html
The 11th regiment monument with Sallie is here: http://www.soldiergeek.com/milblog/2011/7/11/war-dog-memorials-8-gettysburg.html